[Dovecot] Delete antispam emails

Johannes Berg johannes at sipsolutions.net
Sun Apr 13 10:35:53 EEST 2008


> This is what I found in syslog...
> 
> Apr 12 21:28:15 kosh imap: antispam: plugin initialising
> Apr 12 21:28:15 kosh imap: antispam: "trash" is trash folder
> Apr 12 21:28:15 kosh imap: antispam: "Trash" is trash folder
> Apr 12 21:28:15 kosh imap: antispam: "Deleted Items" is trash folder
> Apr 12 21:28:15 kosh imap: antispam: "SpamTrain" is spam folder
> Apr 12 21:28:15 kosh imap: antispam: "INBOX.SpamTrain" is spam folder
> ...
> 
> It looks like all the folders are being recognised correctly. 

Good, yes, that confirms at least the configuration is working.

> Is it
> possible to get more info when messages are being processed?

Not as-is, but you can try something like the patch below:

diff --git a/antispam-storage-1.0.c b/antispam-storage-1.0.c
index 1949454..da21ba4 100644
--- a/antispam-storage-1.0.c
+++ b/antispam-storage-1.0.c
@@ -88,12 +88,18 @@ antispam_copy(struct mailbox_transaction_context *t, struct mail *mail,
 		return -1;
 	}
 
+	debug("mail copy: from trash: %d, to trash: %d\n",
+	      mailbox_is_trash(mail->box), mailbox_is_trash(t->box));
+
 	if (!mailbox_is_trash(mail->box) &&
 	    !mailbox_is_trash(t->box)) {
 		bool src_spam = mailbox_is_spam(mail->box);
 		bool dst_spam = mailbox_is_spam(t->box);
 		bool src_unsu = mailbox_is_unsure(mail->box);
 
+		debug("mail copy: src spam: %d, dst spam: %d, src unsure: %d\n",
+		      src_spam, dst_spam, src_unsu);
+
 		if ((src_spam || src_unsu) && !dst_spam)
 			asbox->movetype = MMT_TO_CLEAN;
 		else if ((!src_spam || src_unsu) && dst_spam)




More information about the dovecot mailing list