From 8fff6b180dd72ca3371b6cd2556654bd94a85abb Mon Sep 17 00:00:00 2001 From: Nico Graf Date: Fri, 29 Nov 2024 16:10:52 +0100 Subject: [PATCH] make it clear that sieve logs are only written on error; add sieve-test example --- source/mail-filters.rst | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/source/mail-filters.rst b/source/mail-filters.rst index 3e03c5c..7ec0203 100644 --- a/source/mail-filters.rst +++ b/source/mail-filters.rst @@ -134,7 +134,21 @@ Troubleshooting Logging ------- -If something does not work check the logs at ``~/users/$MAILBOX/.dovecot.sieve.log``. You can also use `Fastmail's Sieve Tester `_ to test the syntax of scripts and checks what actions a script causes to the provided email message. +If something does not work check the log at ``~/users/$MAILBOX/.dovecot.sieve.log``. However, this log is only written if Sieve itself encounters an error. If it does not exist, your script was executed successfully. + +Debugging tools +--------------- + +You can use the ``sieve-test`` command-line utility to test your Sieve filter script and see which options would be performed: + +.. code-block:: console + + [isabell@stardust ~]$ SENDER_ADDRESS=mail@example.com # replace mail@example.com with the sender address to test + [isabell@stardust ~]$ TEST_MAILBOX=isa # replace isa with the name of the mailbox to test + [isabell@stardust ~]$ EMAIL_FILE=/home/isabell/testmail.eml # replace the path with the path to the mail file you want to test + [isabell@stardust ~]$ sieve-test -D -t - -Tlevel=matching -a $SENDER_ADDRESS -l $HOME/users/$TEST_MAILBOX $HOME/users/$TEST_MAILBOX/.dovecot.sieve $EMAIL_FILE + +You can also use `Fastmail's Sieve Tester `_ to test the syntax of scripts and checks what actions a script causes to the provided email message. Mailaddress with dots ---------------------