(Resending because of size limit exceeded on previous post)
Hi Jens
that looks much better, though not yet completely solved. What you're
now getting is both rules firing when you move a message to Junk,
whereas you only want the first one firing. I guess you will have no
rules firing when you move from Junk to elsewhere. My suspicion is that
for APPEND event the target and destination mailboxes are set to the
same value. i.e. APPEND event for moving to Junk will have
mailbox=INBOX/Junk and from=INBOX/Junk which fires both rules, whereas
when moving from Junk to INBOX mailbox=INBOX and from=INBOX, leading to
KO for rule one on "mailbox" and KO on rule 2 for "from".
Static mailbox rule [1]: mailbox=`INBOX/Junk' from=`*' causes=(COPY
APPEND) => before=`file:/usr/lib/dovecot/sieve/report-spam.sieve'
after=(none)
Static mailbox rule [2]: mailbox=`*' from=`INBOX/Junk' causes=(COPY APPEND) =>
before=`file:/usr/lib/dovecot/sieve/report-ham.sieve' after=(none)
Whenever I do the move of the message I get a MOVE (which is treated
like COPY). I don't see these APPEND events. Not sure why your email
client generates APPEND instead of MOVE. That could be a point to
investigate. If you're going to have to manage APPEND events you'll
probably need different rules. If you'll going to manage MOVE/COPY and
APPEND events then you can probably combine sets of rules (adjusting the
sequential numbering).
The following work for MOVE/COPY events
imapsieve_mailbox1_before =file:/usr/lib/dovecot/sieve/report-spam.sieve
imapsieve_mailbox1_causes = COPY
imapsieve_mailbox1_name = INBOX/Junk
imapsieve_mailbox2_before =file:/usr/lib/dovecot/sieve/report-ham.sieve
imapsieve_mailbox2_causes = COPY
imapsieve_mailbox2_from = INBOX/Junk
imapsieve_mailbox2_name = *
The following should work for APPEND events, but it won't support
wildcards fo rule 2 else it will fire when moving to Junk as well as
from Junk. I'm pretty sure you can't specify negation e.g.
imapsieve_mailbox2_name = !INBOX/Junk, which is what would be needed to
make it work for moving from Junk to any mailbox. As written rule 2
fires for moving from Junk to INBOX
imapsieve_mailbox1_before =file:/usr/lib/dovecot/sieve/report-spam.sieve
imapsieve_mailbox1_causes = APPEND
imapsieve_mailbox1_name = INBOX/Junk
imapsieve_mailbox2_before =file:/usr/lib/dovecot/sieve/report-ham.sieve
imapsieve_mailbox2_causes = APPEND
imapsieve_mailbox2_name = INBOX
John
On 02/07/2024 14:51, postfix_dovecot--- via dovecot wrote:
Gotcha!!!!!!!!
It looks like you nailed it John! (Log and config attached)
The log looks now very different and my log entry is also shown.
Now I can continue working at this point. Adjusting the events i.e.
The reason was actually simple - but I spent a few evenings searching and was
blind. I could have figured it out on my own! Thank you so much John for took
such care of this issue!!!!!
Jens
_______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org