[Dovecot] sieve rules processing

pod pod at herald.ox.ac.uk
Thu Aug 6 20:11:19 EEST 2009


Stephan Bosch <stephan at rename-it.nl> writes:

> Yes, your second rule is an elsif, meaning that it is only executed when
> the first if-condition is not 'true'. Since that first rule has a forced
> true' result, the second rule is absolutely never executed. You script
> should be:
>
> require ["fileinto","copy"];
>
> # rule:[redirect]
> if true
> {
>   redirect :copy "alice at domain.com";
> }
>
> # rule:[Cron]
> if header :contains "Subject" "Cron"
> {
>   fileinto "INBOX/Cron";
> }
>
> Note that the anyof() commands are only necessary when you have multiple
> tests per if command. Also, I removed the envelope require, since it is
> not used.

Out of interest is the conditional around

    if true
    {
      redirect :copy "alice at domain.com";
    }

necessary?  Does a plain inline

    redirect :copy "alice at domain.com";

not behave in exactly the same manner?

I'm afraid it's a while since I read RFC 5228 (Sieve) and I was unfamiliar
with RFC 3894 (:copy) but on scanning through them I can't see anything to
indicate that behaviour should differ inside and outside an "if".

So I suppose my question is does "redirect :copy" have different behaviour
based on whether it is inline or inside an "if"?


More information about the dovecot mailing list