[Dovecot] sieve.before script is taking preceedence over user defined rules

Alexis Lelion alexis.lelion at gmail.com
Thu Mar 15 11:48:52 EET 2012


Hello,

In my current setup, I have a spam filter upstream that adds a
specific header - X-Spam-Level on every incoming mail. Based on this
level, the mail will be moved to the user spam folder using sieve by
doing "fileinto :create 'spam';"
Unfortunately, some legitimate email may end up in this spam folder,
so I have kind of a whitelist that performs an explicit keep over
specific trusted domains. So, my complete spam filtering rule is :
if address :domain :contains "From" ["mycompany.tld", "trusted.tld" ]{
    keep;
elseif header :contains "X-Spam-Level" ["0","1","2"] {
    fileinto :create "__spam__";
}
This rule is stored in "/var/lib/dovecot/sieve/before.sieve", which is
my "sieve_before" file as defined in /etc/dovecot/conf.d/90-sieve.conf

This works as expected except that it doesn't take into account users
filtering for domains that were matched for the explicit keep. For
example, I have the following rule :
if address :domain "From" "trusted.tld" {
    fileinto "trusted"
}
But mail coming from that domain are still delivered in my mailbox.

Is there something I'm missing here? I guess yes, otherwise it would
work as I want ^_^
Any help/comment is appreciated

Thanks!

Alexis



More information about the dovecot mailing list