Dear Maintainer,
sievec (and the other lib-sieve-tool-based CLI utilities: sieve-test,
sieve-filter, sieve-dump) fails to resolve any Sieve "include" of a
non-personal script type (:global, :before, :after), always reporting
the included script as nonexistent even when correctly configured.
Real mail delivery via dovecot-lda/dovecot-lmtp is NOT affected, only
the CLI tools.
Reproduction:
# /etc/dovecot/local.conf
sieve_script personal {
type = personal
driver = file
path = ~/sieve
active_path = ~/.dovecot.sieve
}
sieve_script global {
type = global
driver = file
path = /etc/sieve
}
# /home/testuser/.dovecot.sieve
require ["include"];
include :global "spam";
# /etc/sieve/spam.sieve
require ["fileinto"];
fileinto "Spam";
$ sievec -c /etc/dovecot/dovecot.conf /home/testuser/.dovecot.sieve
.dovecot: line 2: error: included global script 'spam' does not exist.
sievec: Fatal: failed to compile sieve script
Root cause: sievec registers the script file given on the command line
as a synthetic "sieve_script" entry via settings_override(), using the
filter key "sieve_script" without a "+" suffix. In Dovecot's
settings-override mechanism, a filter-array key without "+" *replaces*
the whole array instead of adding to it, so every other configured
sieve_script block (global/default/personal) gets wiped out the moment
any CLI tool is pointed at a script file.
Already fixed upstream with a one-line commit:
https://github.com/dovecot/pigeonhole/commit/c80a52d59a92c139cca481c9af718a2fbfa0ae78