Browse Source

Complete rmilter/rspamd setup.

Carl Meyer 8 years ago
parent
commit
1a3d01f311

+ 12
- 0
roles/mailserver/files/etc_rmilter.conf.common View File

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 View File

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 View File

11
   tags:
11
   tags:
12
     - dependencies
12
     - dependencies
13
 
13
 
14
-- name: Install Rspamd and Rmilter
14
+- name: Install Rspamd, Rmilter, and Redis
15
   apt: pkg={{ item }} state=installed update_cache=yes
15
   apt: pkg={{ item }} state=installed update_cache=yes
16
   with_items:
16
   with_items:
17
     - rspamd
17
     - rspamd
18
     - rmilter
18
     - rmilter
19
+    - redis-server
19
   tags:
20
   tags:
20
     - dependencies
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 View File

101
 local_recipient_maps = $virtual_mailbox_maps
101
 local_recipient_maps = $virtual_mailbox_maps
102
 
102
 
103
 # Milters: OpenDKIM, OpenDMARC, Rspamd
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
 non_smtpd_milters = $smtpd_milters
105
 non_smtpd_milters = $smtpd_milters
106
 milter_protocol = 6
106
 milter_protocol = 6
107
 milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen} {auth_type}
107
 milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen} {auth_type}

Loading…
Cancel
Save