sieve scripts using alphabetical order

This commit is contained in:
youtous 2020-05-04 09:57:42 +02:00
parent 92414b7eba
commit 32d16084ec
No known key found for this signature in database
GPG key ID: 592173AE8CD254A5
2 changed files with 9 additions and 9 deletions

View file

@ -620,26 +620,26 @@ function _setup_dovecot() {
mkdir -p /usr/lib/dovecot/sieve-global/after
if [ -f /tmp/docker-mailserver/before.dovecot.sieve ]; then
cp /tmp/docker-mailserver/before.dovecot.sieve /usr/lib/dovecot/sieve-global/before/
sievec /usr/lib/dovecot/sieve-global/before/before.dovecot.sieve
cp /tmp/docker-mailserver/before.dovecot.sieve /usr/lib/dovecot/sieve-global/before/50-before.dovecot.sieve
sievec /usr/lib/dovecot/sieve-global/before/50-before.dovecot.sieve
else
rm -f /usr/lib/dovecot/sieve-global/before/before.dovecot.sieve /usr/lib/dovecot/sieve-global/before/before.dovecot.svbin
rm -f /usr/lib/dovecot/sieve-global/before/50-before.dovecot.sieve /usr/lib/dovecot/sieve-global/before/50-before.dovecot.svbin
fi
if [ -f /tmp/docker-mailserver/after.dovecot.sieve ]; then
cp /tmp/docker-mailserver/after.dovecot.sieve /usr/lib/dovecot/sieve-global/after/
sievec /usr/lib/dovecot/sieve-global/after/after.dovecot.sieve
cp /tmp/docker-mailserver/after.dovecot.sieve /usr/lib/dovecot/sieve-global/after/50-after.dovecot.sieve
sievec /usr/lib/dovecot/sieve-global/after/50-after.dovecot.sieve
else
rm -f /usr/lib/dovecot/sieve-global/after/after.dovecot.sieve /usr/lib/dovecot/sieve-global/after/after.dovecot.svbin
rm -f /usr/lib/dovecot/sieve-global/after/50-after.dovecot.sieve /usr/lib/dovecot/sieve-global/after/50-after.dovecot.svbin
fi
# sieve will move spams to .Junk folder when SPAMASSASSIN_SPAM_TO_INBOX=1 and MOVE_SPAM_TO_JUNK=1
if [ "$SPAMASSASSIN_SPAM_TO_INBOX" = 1 ] && [ "$MOVE_SPAM_TO_JUNK" = 1 ]; then
notify 'inf' "Spam messages will be moved to the Junk folder."
cp /etc/dovecot/sieve/before/spam.sieve /usr/lib/dovecot/sieve-global/before/
sievec /usr/lib/dovecot/sieve-global/before/spam.sieve
cp /etc/dovecot/sieve/before/60-spam.sieve /usr/lib/dovecot/sieve-global/before/
sievec /usr/lib/dovecot/sieve-global/before/60-spam.sieve
else
rm -f /usr/lib/dovecot/sieve-global/before/spam.sieve /usr/lib/dovecot/sieve-global/before/spam.svbin
rm -f /usr/lib/dovecot/sieve-global/before/60-spam.sieve /usr/lib/dovecot/sieve-global/before/60-spam.svbin
fi
chown docker:docker -R /usr/lib/dovecot/sieve*