[Dovecot] Question about sieve script execution

Stephan Bosch stephan at rename-it.nl
Thu Sep 3 02:13:49 EEST 2009


Mel Flynn schreef:
> Hi,
> 
> after reading the wiki about sieve_before/sieve_after and sieve_global_path, 
> it's still unclear to me if:
> sieve_before scripts are executed if no user script exists, but a global 
> script is defined.
At least one (the first) sieve_before script is always executed, 
irrespective of whether the user's personal script or the script defined 
with sieve_global_path exist. If sieve_before refers to more than one 
script (i.e. it points to a directory), subsequent scripts in that 
directory are executed as long as preceding scripts have a 'keep' verdict.

> The reason I ask, is because I'd like to use the same script, so that I don't 
> have to maintain two scripts to apply "company policy" or "global features". 
> It seems implicit from this sentence, but I've been taught not to assume 
> implicitness by various pieces of software ;)
Specifying sieve_before will do the trick.

> "This is not possible using the sieve_global_path setting, because that is 
> only used when the user's private script does not exist."
Yes, sieve_global_path merely serves as a means to provide default 
behavior, i.e. behavior that can be overridden by the user by uploading 
a personal script. In contrast, there is no way the user can prevent the 
execution of the sieve_before scripts.

The sieve_after setting is a different story. It could be used to change 
what happens when the user's script yields 'keep'. It is mainly provided 
for completeness and I have not found very common uses for it, although 
I believe it is actually being used at some sites. Users can prevent 
execution of sieve_after by using fileinto "INBOX" in stead of keep in 
their personal script.

Regards,

-- 
Stephan Bosch
stephan at rename-it.nl


More information about the dovecot mailing list