unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Macros for notmuch and bayesian spam learner (dspam)
@ 2016-05-23 12:58 notmuch
  2016-05-23 16:34 ` Tomi Ollila
  0 siblings, 1 reply; 2+ messages in thread
From: notmuch @ 2016-05-23 12:58 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 1425 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Macros for notmuch and bayesian spam learner (dspam)
  2016-05-23 12:58 Macros for notmuch and bayesian spam learner (dspam) notmuch
@ 2016-05-23 16:34 ` Tomi Ollila
  0 siblings, 0 replies; 2+ messages in thread
From: Tomi Ollila @ 2016-05-23 16:34 UTC (permalink / raw)
  To: notmuch, notmuch

On Mon, May 23 2016, notmuch@gaenseri.ch wrote:

> [ Unknown signature status ]
> 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?

Put learn_ham/ & learn_spam/ outside of the path notmuch looks for mail
files.

now notmuch *should* notice renames for your spam/inbox folders
(but please keep sending mails if this is not the case)



Instead of copying you could try hard/symlinking, but then dspam may
modify the files (if that matters).




> Thanks for your help in advance, Julius

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-23 16:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-23 12:58 Macros for notmuch and bayesian spam learner (dspam) notmuch
2016-05-23 16:34 ` Tomi Ollila

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).