[Dovecot] Rename sieve_after to global_sieve_after and create a global_sieve_before file

master
andryyy 2019-06-01 13:53:24 +02:00
parent aaf0d521a2
commit dcacf85a5d
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
5 changed files with 16 additions and 6 deletions

View File

@ -118,8 +118,11 @@ default_pass_scheme = SSHA256
password_query = SELECT password FROM mailbox WHERE active = '1' AND username = '%u' AND domain IN (SELECT domain FROM domain WHERE domain='%d' AND active='1') AND JSON_EXTRACT(attributes, '$.force_pw_update') NOT LIKE '%%1%%' password_query = SELECT password FROM mailbox WHERE active = '1' AND username = '%u' AND domain IN (SELECT domain FROM domain WHERE domain='%d' AND active='1') AND JSON_EXTRACT(attributes, '$.force_pw_update') NOT LIKE '%%1%%'
EOF EOF
# Create global sieve_after script # Migrate old sieve_after file
cat /usr/local/etc/dovecot/sieve_after > /var/vmail/sieve/global.sieve [[ -f /usr/local/etc/dovecot/sieve_after ]] && mv /usr/local/etc/dovecot/sieve_after /usr/local/etc/dovecot/global_sieve_after
# Create global sieve scripts
cat /usr/local/etc/dovecot/global_sieve_after > /var/vmail/sieve/global_sieve_after.sieve
cat /usr/local/etc/dovecot/global_sieve_before > /var/vmail/sieve/global_sieve_before.sieve
# Check permissions of vmail/attachments directory. # Check permissions of vmail/attachments directory.
# Do not do this every start-up, it may take a very long time. So we use a stat check here. # Do not do this every start-up, it may take a very long time. So we use a stat check here.
@ -181,7 +184,8 @@ else
fi fi
# Compile sieve scripts # Compile sieve scripts
sievec /var/vmail/sieve/global.sieve sievec /var/vmail/sieve/global_sieve_before.sieve
sievec /var/vmail/sieve/global_sieve_after.sieve
sievec /usr/local/lib/dovecot/sieve/report-spam.sieve sievec /usr/local/lib/dovecot/sieve/report-spam.sieve
sievec /usr/local/lib/dovecot/sieve/report-ham.sieve sievec /usr/local/lib/dovecot/sieve/report-ham.sieve

View File

@ -331,9 +331,10 @@ plugin {
sieve_vacation_min_period = 5s sieve_vacation_min_period = 5s
sieve_vacation_max_period = 0 sieve_vacation_max_period = 0
sieve_vacation_default_period = 60s sieve_vacation_default_period = 60s
sieve_before = dict:proxy::sieve_before;name=active;bindir=/var/vmail/sieve_before_bindir sieve_before = /var/vmail/sieve/global_sieve_before.sieve
sieve_before2 = dict:proxy::sieve_before;name=active;bindir=/var/vmail/sieve_before_bindir
sieve_after = dict:proxy::sieve_after;name=active;bindir=/var/vmail/sieve_after_bindir sieve_after = dict:proxy::sieve_after;name=active;bindir=/var/vmail/sieve_after_bindir
sieve_after2 = /var/vmail/sieve/global.sieve sieve_after2 = /var/vmail/sieve/global_sieve_after.sieve
# -- Global keys # -- Global keys
mail_crypt_global_private_key = </mail_crypt/ecprivkey.pem mail_crypt_global_private_key = </mail_crypt/ecprivkey.pem

View File

@ -1,3 +1,6 @@
# global_sieve_after script
# global_sieve_before -> user sieve_before (mailcow UI) -> user sieve_after (mailcow UI) -> global_sieve_after
require "fileinto"; require "fileinto";
require "mailbox"; require "mailbox";
require "variables"; require "variables";

View File

@ -0,0 +1,2 @@
# global_sieve_before script
# global_sieve_before -> user sieve_before (mailcow UI) -> user sieve_after (mailcow UI) -> global_sieve_after

View File

@ -173,7 +173,7 @@ services:
- sogo - sogo
dovecot-mailcow: dovecot-mailcow:
image: mailcow/dovecot:1.76 image: mailcow/dovecot:1.77
build: ./data/Dockerfiles/dovecot build: ./data/Dockerfiles/dovecot
cap_add: cap_add:
- NET_BIND_SERVICE - NET_BIND_SERVICE