#1151164 dovecot-sieve: sievec fails to resolve :global/:before/:after includes

Package:
dovecot-sieve
Source:
dovecot-sieve
Description:
secure POP3/IMAP server - Sieve filters support
Submitter:
Jordi Mallach
Date:
2026-10-17 19:59:01 UTC
Severity:
normal
Tags:
#1151164#5
Date:
2026-10-17 16:43:54 UTC
From:
To:
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

#1151164#10
Date:
2026-10-17 19:57:52 UTC
From:
To:
Control: tags -1 + pending

Thanks.  I've added this patch to the trixie branch and will include it
in the next stable update.

noah