> On February 10, 2017 at 9:25 AM George Kontostanos <gkontos.mail at gmail.com> wrote:[snip]> I think that this needs some change: > > # From Spam folder to elsewhere > imapsieve_mailbox2_name = * > imapsieve_mailbox2_from = Spam > imapsieve_mailbox2_causes = COPY > imapsieve_mailbox2_before = file:/usr/lib/dovecot/sieve/report-ham.sieve > > When a message from Spam is moved to Trash then the report-ham.sieve is > being executed. > > Can we add an exception for the Trash folder?This is handled in the sieve script. E.g.: require "environment"; if environment "imap.mailbox" "Trash" { stop; } michael
On 10.02.17 18:34, Michael Slusarz wrote:> > Can we add an exception for the Trash folder? > > This is handled in the sieve script. E.g.: > > require "environment"; > if environment "imap.mailbox" "Trash" { > stop; > }This does not work for me, and I don't really expect it to work either. https://tools.ietf.org/html/rfc6785#section-4.4 states: The implementation MUST set the Environment [RFC5183] item "imap.mailbox" to the name of the mailbox that the affected message is in, in the case of existing messages, or is targeted to be stored into, in the case of new messages. The message already exists in the Spam folder, hence imap.mailbox should be "Spam" instead of "Trash", correct? Is there perhaps another way to ensure that manually deleted spam is not erroneously learned as ham? -Ralph
> On February 10, 2017 at 12:13 PM Ralph Seichter wrote: > > On 10.02.17 18:34, Michael Slusarz wrote: > > > Can we add an exception for the Trash folder? > > This is handled in the sieve script. E.g.: > > > > require "environment"; > > if environment "imap.mailbox" "Trash" { > > stop; > > } > > This does not work for me, and I don't really expect it to work either. > https://tools.ietf.org/html/rfc6785#section-4.4 states: > > The implementation MUST set the Environment [RFC5183] item "imap.mailbox" > to the name of the mailbox that the affected message is in, in the > case of existing messages, or is targeted to be stored into, in the > case of new messages. > > The message already exists in the Spam folder, hence imap.mailbox should > be "Spam" instead of "Trash", correct?Incorrect. When you move a message to a new mailbox, that is a "new message" event (a new UID in the target mailbox is created; the message count increases).? So imap.mailbox is set to the name of the *target* mailbox.> Is there perhaps another way to ensure that manually deleted spam is not > erroneously learned as ham? > > -Ralph