[Dovecot] Dovecot-sieve processing optimizations

Seth Mattinen sethm at rollernet.us
Wed Oct 8 21:07:09 EEST 2008


Roderick A. Anderson wrote:
> I'm working at the next part of the virtual domains mail server.  I'm
> moving this account (raanders at acm.org is a forwarder) which has a bunch
> of procmail rules to file into folders.
> 
> My question is if it is more efficient is use?
> 
> if  {
>    ...
> } elsif {
>    ...
> } elsif {
>    ...
> }
> else
> 
> This seems to be the way many of the example scripts do it but I found
> at least one that used
> 
> if {
>    ...
> }
> 
> if {
>    ...
> }
> 
> Which is more procmail like and for me reads easier.
> 
> If not here where should I ask?
> 

Well, both accomplish different things. In the first example, one and
only one of the conditions will be executed. In the second one, more
than one could possibly be executed.

I've never looked at Sieve's code, but the first will stop at the first
matching condition. In the second case, because you could make it do
more than one thing, it must check each condition.

~Seth


More information about the dovecot mailing list