Macros for notmuch and bayesian spam learner (dspam)

Subject: Macros for notmuch and bayesian spam learner (dspam)

Date: Mon, 23 May 2016 14:58:09 +0200

To: notmuch@notmuchmail.org

Cc:

From: notmuch@gaenseri.ch


Hey,
I'm using notmuch with mutt-kz. I'm running dspam (a bayesian spam classifier), so I've got an imap folder called "learn_spam" and a folder called "learn_ham" (for training dspam). Both folders are periodically emptied by dspam. I want to define three macros that are achieving the following results:

#mark message as spam -> copy message to "learn_spam" and move it to the real folder "spam"
macro index,pager \Cs "<copy-message>=learn_spam<enter><enter><save-message>=spam<enter><enter><modify-labels>+spam\n<sync-mailbox>"

#mark falsely classified spam message as ham -> copy message to "learn_ham" and move it to the real folder "inbox"
macro index,pager \Ch "<copy-message>=learn_ham\n<save-message>=INBOX <modify-labels>-spam +inbox\n<sync-mailbox>"

#archive message - copy message to learn_ham
macro index,pager \Ca "<copy-message>=learn_ham<enter><enter><modify-labels>-inbox +archive\n<sync-mailbox>"

There is only one big problem: after I've copied the mail to the two learn folders and after they are being deleted (after processing) from dspam they are kind of non-existing for dspam. So I only want to copy the message to the learning folders, but after they are being extenally deleted from these folders notmuch thinks that they are away and is apparently not able to detect that there is still one copy of these messages present.

Do you know how to fix that?
Thanks for your help in advance, Julius
signature.asc (application/pgp-signature)

Thread: