From 6c492e854e04bf7f823929f2c18e2ee3b3cda74f Mon Sep 17 00:00:00 2001 From: Pierre Jaury Date: Sun, 21 Feb 2016 15:07:12 +0100 Subject: [PATCH] Enable sieve and move spam to Junk --- config/dovecot/after.sieve | 5 +++++ config/dovecot/before.sieve | 0 config/dovecot/default.sieve | 0 config/dovecot/dovecot.conf | 33 ++++++++++++++++++++++++--------- 4 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 config/dovecot/after.sieve create mode 100644 config/dovecot/before.sieve create mode 100644 config/dovecot/default.sieve diff --git a/config/dovecot/after.sieve b/config/dovecot/after.sieve new file mode 100644 index 00000000..93632657 --- /dev/null +++ b/config/dovecot/after.sieve @@ -0,0 +1,5 @@ +require ["fileinto", "envelope", "mailbox"]; + +if header :contains "X-Spam-Flag" "YES" { + fileinto :create "Junk"; +} diff --git a/config/dovecot/before.sieve b/config/dovecot/before.sieve new file mode 100644 index 00000000..e69de29b diff --git a/config/dovecot/default.sieve b/config/dovecot/default.sieve new file mode 100644 index 00000000..e69de29b diff --git a/config/dovecot/dovecot.conf b/config/dovecot/dovecot.conf index 3fe18b47..cbee16cf 100644 --- a/config/dovecot/dovecot.conf +++ b/config/dovecot/dovecot.conf @@ -17,6 +17,26 @@ mail_gid = mail mail_privileged_group = mail mail_access_groups = mail +namespace inbox { + inbox = yes + mailbox Trash { + auto = subscribe + special_use = \Trash + } + mailbox Drafts { + auto = subscribe + special_use = \Drafts + } + mailbox Sent { + auto = subscribe + special_use = \Sent + } + mailbox Junk { + auto = subscribe + special_use = \Junk + } +} + ############### # TLS ############### @@ -80,9 +100,7 @@ service imap-login { ############### protocol lmtp { -} - -protocol lda { + mail_plugins = $mail_plugins sieve recipient_delimiter = + } @@ -108,16 +126,13 @@ service dict { service managesieve-login { inet_listener sieve { port = 4190 - } - inet_listener sieve_deprecated { - port = 2000 } } plugin { sieve = ~/.sieve sieve_dir = ~/sieve - sieve_before = /var/lib/dovecot/sieve/before.sieve - sieve_default = /var/lib/dovecot/sieve/default.sieve - sieve_after = /var/lib/dovecot/sieve/after.sieve + sieve_before = /etc/dovecot/before.sieve + sieve_default = /etc/dovecot/default.sieve + sieve_after = /etc/dovecot/after.sieve }