Pārlūkot izejas kodu

Complete rmilter/rspamd setup.

Carl Meyer 8 gadus atpakaļ
vecāks
revīzija
1a3d01f311

+ 12
- 0
roles/mailserver/files/etc_rmilter.conf.common Parādīt failu

@@ -0,0 +1,12 @@
1
+spamd {
2
+	servers = r:localhost:11333;
3
+	whitelist = 127.0.0.1/32, 192.168.0.0/16, [::1]/128;
4
+};
5
+
6
+redis {
7
+	servers_id = localhost;
8
+	id_prefix = "message_id.";
9
+};
10
+
11
+tempdir = /tmp;
12
+max_size = 10M;

+ 8
- 0
roles/mailserver/files/lib_systemd_system_rmilter.socket Parādīt failu

@@ -0,0 +1,8 @@
1
+[Unit]
2
+Description=Another sendmail milter for different mail checks
3
+
4
+[Socket]
5
+ListenStream=9900
6
+
7
+[Install]
8
+WantedBy=sockets.target

+ 17
- 1
roles/mailserver/tasks/rspamd.yml Parādīt failu

@@ -11,10 +11,26 @@
11 11
   tags:
12 12
     - dependencies
13 13
 
14
-- name: Install Rspamd and Rmilter
14
+- name: Install Rspamd, Rmilter, and Redis
15 15
   apt: pkg={{ item }} state=installed update_cache=yes
16 16
   with_items:
17 17
     - rspamd
18 18
     - rmilter
19
+    - redis-server
19 20
   tags:
20 21
     - dependencies
22
+
23
+- name: Configure rmilter
24
+  copy: src=etc_rmilter.conf.common dest=/etc/rmilter.conf.common
25
+
26
+- name: Configure rmilter socket service
27
+  copy: src=lib_systemd_system_rmilter.socket dest=/lib/systemd/system/rmilter.socket
28
+
29
+- name: Start redis
30
+  service: name=redis-server state=started
31
+
32
+- name: Start rspamd systemd socket listener
33
+  service: name=rspamd.socket state=started
34
+
35
+- name: Start rmilter systemd socket listener
36
+  service: name=rmilter.socket state=started

+ 1
- 1
roles/mailserver/templates/etc_postfix_main.cf.j2 Parādīt failu

@@ -101,7 +101,7 @@ virtual_alias_maps = pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf
101 101
 local_recipient_maps = $virtual_mailbox_maps
102 102
 
103 103
 # Milters: OpenDKIM, OpenDMARC, Rspamd
104
-smtpd_milters = inet:127.0.0.1:8891,inet:127.0.0.1:54321,unix:/var/run/rmilter/rmilter.sock
104
+smtpd_milters = inet:127.0.0.1:8891,inet:127.0.0.1:54321,inet:127.0.0.1:9900
105 105
 non_smtpd_milters = $smtpd_milters
106 106
 milter_protocol = 6
107 107
 milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen} {auth_type}

Notiek ielāde…
Atcelt
Saglabāt