[Dovecot] Manual manipulation of Sieve files

Stephan Bosch stephan at rename-it.nl
Fri Jun 22 10:08:05 EEST 2012

On 6/21/2012 8:32 PM, email builder wrote:
> We have some scripts that take care of some tasks when creating new email accounts, such as creating some default mail filter rules.
> I know Sieve scripts are plain text files, but need to be compiled for use.  I see that you can use seivec to compile scripts manually, which can help me create .dovecot.svbin which can be placed where needed and permissioned correctly.  But a couple questions:
> * Sieve has the concept of an active script - is this merely whatever is compiled into the .dovecot.svbin file?

This is the script file that the sieve= setting points to. The term 
'active' only has real meaning when ManageSieve is used. Then, the 
active script file is a symbolic link that points into the sieve_dir= 
directory, thereby selecting which script is active.

> * Does dovecot (managesieve) do any other housekeeping when a user sieve script is installed and set as the active script?  I would need to replicate this manually.

It makes the symbolic link. Compiling the script is done automatically 
when the script is first executed at delivery.

> * If the default script is always the same (sorry, for us, the solution isn't global scripts), would it work to compile that script once, keep the compiled version somewhere and merely copy it into the correct place for a new user?  Are there issues with this?
You can pre-compile it, but the plaintext script must also exist at the 
indicated location. Sieve always looks for the plaintext script and only 
when that is found it checks for the presence of an earlier compiled binary.

> * Should we always have the plain text version along with the compiled one for proper managesieve operation going forward (users can edit their sieve scripts)




More information about the dovecot mailing list