[Dovecot] Sieve plugin not running on all messages

Stephan Bosch stephan at rename-it.nl
Mon Jul 13 00:00:59 EEST 2009


Hi Joan,

Joan Moreau wrote:
> I have a global script (run by "run_before" in dovecot.conf) and a user 
> script.
> 
> All scripts get compiled correctly and running.
> 
> however , times to times, the filters are not applied, whereas they 
> should, especially the one run all the time, against Spam:
> 
> -------------------------------
> require ["fileinto", "reject"];
> 
> if anyof(
>    header :contains ["Subject"] ["***SPAM***"],
>    header :contains ["X-Spam-Flag"] ["YES"]
>    )
> {
>   fileinto "Spam";
>   reject "Your message has been considered SPAM by our mail server";
>   stop;
> }
This Sieve script will fail at runtime if any of the presented 
conditions is true, because the reject action conflicts with fileinto. 
This should have produced an error message in your Dovecot logs. When 
this situation occurs, the implicit keep action is executed meaning that 
the message is delivered into the default folder.

> My config dovecot:
> ...
> plugin {
>    sieve_before=/data/mail/global.sieve
>    sieve_global_path=/data/mail/global.sieve
>    sieve_global_dir=/data/mail
>    sieve_dir=/data/mail/%d/%n/sieve
>    sieve=/data/mail/%d/%n/local.sieve
> }

Also, the config above will execute global.sieve two times sequentially 
if the user has no local.sieve, which is probably not what you want. Set 
sieve_global_path only when you want to give users some default 
filtering when they do not have a script of their own. The sieve_before 
setting is normally used to force sieve rules on all users, even when 
they have a script of their own (it is executed before theirs).

PS: Please do not hijack threads by replying to an unrelated message. 
Just start a new topic.

Regards,

Stephan.



More information about the dovecot mailing list