Ver código fonte

Add default sieve filter to roundcube

Mike Ashley 8 anos atrás
pai
commit
17bb355dfd

+ 11
- 0
roles/webmail/files/var_www_roundcube_config_global.sieve Ver arquivo

@@ -0,0 +1,11 @@
1
+require ["regex", "fileinto", "imap4flags"];
2
+# Catch mail tagged as Spam, except Spam retrained and delivered to the mailbox
3
+if allof (header :regex "X-DSPAM-Result" "^(Spam|Virus|Bl[ao]cklisted)$",
4
+          not header :contains "X-DSPAM-Reclassified" "Innocent") {
5
+  # Mark as read
6
+  setflag "\\Seen";
7
+  # Move into the Junk folder
8
+  fileinto "Spam";
9
+  # Stop processing here
10
+  stop;
11
+}

+ 1
- 1
roles/webmail/files/var_www_roundcube_plugins_managesieve_config.inc.php Ver arquivo

@@ -41,7 +41,7 @@ $config['managesieve_usetls'] = false;
41 41
 $config['managesieve_conn_options'] = null;
42 42
 
43 43
 // default contents of filters script (eg. default spam filter)
44
-$config['managesieve_default'] = '/etc/dovecot/sieve/global';
44
+$config['managesieve_default'] = '/var/www/roundcube/config/global.sieve';
45 45
 
46 46
 // The name of the script which will be used when there's no user script
47 47
 $config['managesieve_script_name'] = 'managesieve';

+ 7
- 0
roles/webmail/tasks/roundcube.yml Ver arquivo

@@ -69,6 +69,13 @@
69 69
     group=www-data
70 70
     mode=0644
71 71
 
72
+- name: Install global sieve
73
+  copy: src=var_www_roundcube_config_global.sieve
74
+    dest=/var/www/roundcube/config/global.sieve
75
+    owner=root
76
+    group=www-data
77
+    mode=0644
78
+
72 79
 - name: Install carddav plugin configuration
73 80
   copy: src=var_www_roundcube_plugins_carddav_config.inc.php
74 81
     dest=/var/www/roundcube/plugins/carddav/config.inc.php

Carregando…
Cancelar
Salvar