Replacement for antispam plugin

Ralph Seichter dovecot-ml at seichter.de
Fri Feb 10 19:59:00 UTC 2017


On 10.02.17 20:34, Michael Slusarz wrote:

> 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.

My tests seem to indicate otherwise. Deleting a message currently
located in the Junk folder causes the report-ham.sieve script to be
invoked, which in my case contains the following:

  require ["vnd.dovecot.pipe", "copy", "environment"];
  if environment "imap.mailbox" "Trash" {
    stop;
  } elsif environment "imap.mailbox" "Junk" {
    pipe :copy "debug-junk";
  } else {
    pipe :copy "learn-ham";
  }

I can see that "learn-ham" is always invoked when a message is deleted
from or moved out of the Junk folder, so my guess is that imap.mailbox
is neither "Trash" nor "Junk" ("debug-junk" is never called, according
to the Dovecot logs). Unfortunately I don't know how to debug this
further.

I don't want "learn-ham" to be run when a message located in the Junk
folder is manually deleted or moved to Trash, and right now I don't know
how to accomplish this.

-Ralph


More information about the dovecot mailing list