Quellcode durchsuchen

Add default sieve filter to roundcube

Mike Ashley vor 8 Jahren
Ursprung
Commit
17bb355dfd

+ 11
- 0
roles/webmail/files/var_www_roundcube_config_global.sieve Datei anzeigen

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 Datei anzeigen

41
 $config['managesieve_conn_options'] = null;
41
 $config['managesieve_conn_options'] = null;
42
 
42
 
43
 // default contents of filters script (eg. default spam filter)
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
 // The name of the script which will be used when there's no user script
46
 // The name of the script which will be used when there's no user script
47
 $config['managesieve_script_name'] = 'managesieve';
47
 $config['managesieve_script_name'] = 'managesieve';

+ 7
- 0
roles/webmail/tasks/roundcube.yml Datei anzeigen

69
     group=www-data
69
     group=www-data
70
     mode=0644
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
 - name: Install carddav plugin configuration
79
 - name: Install carddav plugin configuration
73
   copy: src=var_www_roundcube_plugins_carddav_config.inc.php
80
   copy: src=var_www_roundcube_plugins_carddav_config.inc.php
74
     dest=/var/www/roundcube/plugins/carddav/config.inc.php
81
     dest=/var/www/roundcube/plugins/carddav/config.inc.php

Laden…
Abbrechen
Speichern