[Dovecot] global sieve script

pod pod at herald.ox.ac.uk
Mon Oct 8 18:16:11 EEST 2007


>>>>> "LS" == Lars Stavholm <stava at telcotec.se> writes:

    LS> For example:

    LS> /etc/dovecot/dovecot.conf:
    LS> ...
    LS> protocol lda {
    LS>   ...
    LS>   sieve_global_path = /etc/dovecot/sieve/
    LS>   ...
    LS> }

    LS> /etc/dovecot/global:
    LS> if header :contains "X-Spam-Flag" "YES" {
    LS>   fileinto "Spam";
    LS>   stop;
    LS> }

    LS> ...or something similar.

Definitely take the "something similar" option since the above likely
won't work.

sieve_global_path should point to a _file_ containing a sieve script and
both the script _and_ the byte-compiled version (same name with 'c'
appended) should exist and the compiled output file should have an mtime
later than the source.  If the cmusieve plugin can't find the compiled
version (or the mtime of the source is later than the mtime of the
compiled version) it will attempt to write it out a compiled version and
filesystem permissions really ought to prevent that.

So

/etc/dovecot/dovecot.conf:
...
protocol lda {
  ...
  sieve_global_path = /etc/dovecot/global.sieve
  ...
}

/etc/dovecot/global.sieve:
if header :contains "X-Spam-Flag" "YES" {
  fileinto "Spam";
  stop;
}

AND remember to byte-compile the script

/usr/libexec/dovecot/sievec /etc/dovecot/global.sieve /etc/dovecot/global.sievec


More information about the dovecot mailing list