I've followed this http://sealedabstract.com/code/nsa-proof-your-e-mail-in-2-hours/ tutorial, adjusted to allow for vimbadmin3 users, to set up my mail server. Most of my adjustments come from https://github.com/opensolutions/ViMbAdmin/wiki/Mail-System-Install-on-Ubuntu
The first tutorial uses the dovecot sieve (I think) plugin to route things through dspam. sieve aparently needs a .dovecot.sieve file in the users maildir.
How can I make sure that file is created when dovecot initiates new user maildirs?
Is there a way to create the file in one location, and tell dovecot/sieve to use it on all email accounts?
The file needs to contain:
require ["regex", "fileinto", "imap4flags"];
# Catch mail tagged as Spam, except Spam retrained and delivered to the mailbox
if allof (header :regex "X-DSPAM-Result" "^(Spam|Virus|Bl[ao]cklisted)$",
not header :contains "X-DSPAM-Reclassified" "Innocent") {
# Mark as read
setflag "\\Seen";
# Move into the Junk folder
fileinto "Spam";
# Stop processing here
stop;
}
I'm running Ubuntu 14.04, using dovecot and postfix. I'm creating users in vimbadmin3, so their directory is not created until their first email is received.
Thanks!
There is no need to create this special fiel in every Maildir, use the configuration variable
sieve_before
. To cite the docs:Using
sieve_default
would not be the right way to go, because the script specified with this option is only used, when the user has no own script configured! Usingsieve_before
allows you, to always execute it, irrespective of what the user does himself.