Преглед изворни кода

#626 configure Dovecot to move emails marked as spam by RSpamD to Junk folder.

Pavel Karoukin пре 8 година
родитељ
комит
76296f3440

+ 5
- 0
roles/mailserver/files/etc_dovecot_conf.d_90-sieve.conf Прегледај датотеку

@@ -0,0 +1,5 @@
1
+plugin {
2
+  sieve = ~/.dovecot.sieve
3
+  sieve_dir = ~/sieve
4
+  sieve_before = /etc/dovecot/sieve/before.d
5
+}

+ 8
- 0
roles/mailserver/files/etc_dovecot_sieve_before.d_no-spam.sieve Прегледај датотеку

@@ -0,0 +1,8 @@
1
+require "fileinto";
2
+require "imap4flags";
3
+
4
+if header :is "X-Spam" "Yes" {
5
+    setflag "\\seen";
6
+    fileinto "Junk";
7
+    stop;
8
+}

+ 5
- 0
roles/mailserver/tasks/dovecot.yml Прегледај датотеку

@@ -32,12 +32,17 @@
32 32
 - name: Copy dovecot.conf into place
33 33
   copy: src=etc_dovecot_dovecot.conf dest=/etc/dovecot/dovecot.conf
34 34
 
35
+- name: Configure sieve script moving spam into Junk folder
36
+  copy: src=etc_dovecot_sieve_before.d_no-spam.sieve dest=/etc/dovecot/sieve/before.d/no-spam.sieve owner=vmail group=dovecot
37
+  notify: restart dovecot
38
+
35 39
 - name: Copy additional Dovecot configuration files in place
36 40
   copy: src=etc_dovecot_conf.d_{{ item }} dest=/etc/dovecot/conf.d/{{ item }}
37 41
   with_items:
38 42
     - 10-auth.conf
39 43
     - 10-mail.conf
40 44
     - 10-master.conf
45
+    - 90-sieve.conf
41 46
     - auth-sql.conf.ext
42 47
   notify: restart dovecot
43 48
 

Loading…
Откажи
Сачувај