ansible-mailserver-debian/mail_system/files/dovecot/sieve/before
2026-03-22 13:09:26 +01:00
..
README Update to trixie 2026-03-22 13:09:26 +01:00

# THIS FILE IS CONTROLLED BY ANSIBLE - DO NOT CHANGE IN DEPLOYMENT!


Sieve scripts that will be run before user scripts.

Don't forget to compile the script with

  sievec /etc/dovecot/sieve_before/{name}.sieve

and

  chown mailstore: /etc/dovecot/sieve_before/{name}.*


You may use regular Sieve extensions, but also Dovecot-specific Sieve extensions,
cf. https://wiki2.dovecot.org/Pigeonhole/Sieve .

(Note: We made vnd.dovecot.{pipe,filter,execute} available only in the global context,
they cannot be used by users.)


Example:

require ["vnd.dovecot.filter", "vnd.dovecot.execute", "variables", "envelope", "subaddress"];

if execute :output "out" :pipe "copy_to_matrix" {
  filter "test" "${out}";
}

if envelope :matches :detail "to" "*" {
  set "x" "${1}";
}

filter "test" "${x}";

if envelope :matches :user "to" "*" {
  set "y" "${1}";
}

filter "test" "${y}";