On 29/06/2024 10:08, postfix_dovecot--- via dovecot wrote:
Host: VMware Workstation 14.1.8

OS: Debian 12 (Bookworm)

Dovecot: 2.3.19.1

Postfix: 3.7.10
Mailclient: Outlook 2016

Hello,

I am currently working on a new mail server to replace my Debian 10 mail 
server. For preparation, I use VMware Workstation to learn and test the 
installation steps. When I'm eventually done, I'll rebuild my root server from 
scratch.

This time, my problem is getting the IMAPSieve plugin working to trigger rspamd 
if mail gets moved to the junk folder. Sieve runs well – if rspam recognizes a 
spam mail, it will be transferred to the junk folder.



For me it looks like the IMAPSieve plugin recognizes the move but will not 
running the script behind. I can see some actions in the log but nothing 
happens on the rspamd side where the log is also open to view.
Moving a mail with Outlook produces the following log entry:

imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: Module loaded: 
/usr/lib/dovecot/modules/lib95_imap_sieve_plugin.so

imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: imapsieve: mailbox 
INBOX/Spam: APPEND event

imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: sieve: Pigeonhole 
version 0.5.19 (4eae2f79) initializing

imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: sieve: include: 
sieve_global is not set; it is currently not possible to include `:global' scripts.

imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: sieve: Sieve imapsieve 
plugin for Pigeonhole version 0.5.19 (4eae2f79) loaded

imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: sieve: Sieve 
Extprograms plugin for Pigeonhole version 0.5.19 (4eae2f79) loaded

imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: imapsieve: Static mailbox 
rule [1]: mailbox=`Spam' from=`*' causes=(COPY APPEND) => 
before=`file:/usr/lib/dovecot/sieve/report-spam.sieve' after=(none)

imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: imapsieve: Static mailbox 
rule [2]: mailbox=`*' from=`Spam' causes=(COPY APPEND) => 
before=`file:/usr/lib/dovecot/sieve/report-ham.sieve' after=(none)

imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: imapsieve: mailbox 
INBOX: FLAG event (changed flags: \Deleted)

imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: sieve: Pigeonhole 
version 0.5.19 (4eae2f79) initializing

imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: sieve: include: 
sieve_global is not set; it is currently not possible to include `:global' scripts.

imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: sieve: Sieve imapsieve 
plugin for Pigeonhole version 0.5.19 (4eae2f79) loaded

imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: sieve: Sieve 
Extprograms plugin for Pigeonhole version 0.5.19 (4eae2f79) loaded

imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: imapsieve: Static mailbox 
rule [1]: mailbox=`Spam' from=`*' causes=(COPY APPEND) => 
before=`file:/usr/lib/dovecot/sieve/report-spam.sieve' after=(none)

imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: imapsieve: Static mailbox 
rule [2]: mailbox=`*' from=`Spam' causes=(COPY APPEND) => 
before=`file:/usr/lib/dovecot/sieve/report-ham.sieve' after=(none)

imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: imapsieve: mailbox 
INBOX: FLAG event (changed flags: \Seen)

  ......

Hi Jens

I can't give you any expert advise about that plugin as I haven't used it. However, looking at the debug info you posted I don't see where the rules are being matched.

That debugging looks like it is reading in the configuration, so you can see that dovecot recognises the rules configuration, but nothing in the debugging suggests that those rules are being matched or that you sieve scripts are being executed.

So it seems that the event that is being recognized "mailbox INBOX/Spam: APPEND event" doesn't match your defined rules. Maybe it's to do with name of the mailbox in the event not matching the one in your rule 1. It's a wild guess on my part, but maybe changing the rules to use "INBOX/Spam" might just solve it.

When the rules match you should see a message like "Matched static mailbox rule n" where n=1,2 etc in the debugging output.

John
_______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

Reply via email to