unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: James Vasile <james@hackervisions.org>
To: Daniel Barlow <dan@telent.net>, notmuch@notmuchmail.org
Subject: Re: Spam and mailing list filtering?
Date: Thu, 17 Feb 2011 08:37:45 -0500	[thread overview]
Message-ID: <87sjvmeq8m.fsf@hackervisions.org> (raw)
In-Reply-To: <87ei7ggjx4.fsf@lsip.4a.telent.net>

On Thu, 10 Feb 2011 12:20:55 +0000, Daniel Barlow <dan@telent.net> wrote:
> 1) (How) can I filter on the X-Spam-Bar header to chop out spam and
> suspected spam?

I just integrated Spambayes into my notmuch toolchain.

It's crude, but here's how it works:

My script does `find -mtime 0 | xargs grep -L
^X-Spambayes-Classification` to get all the recent files that aren't
already classified by spambayes.  It passes them to spambayes,
overwrites the mail file with the resulting mail (with spambayes header)
and then does `notmuch tag +spambayes id:$ID` for anythat come back
with "X-Spambayes-Classification: spam".

I suppose that in doing this I might leave myself open to spammers that
pre-seed emails with "X-Spambayes-Classification: ham" tags, but I
searched my mail archives and no messages came with those headers
already in place.

You could do something similar by searching for messages that aren't
tagged either spam or ham, looking in each for the header and adding the
appropriate tag.  It's clunky and maybe even brittle, but it works well
enough until notmuch gains the ability to search for arbitrary headers.

-James

  parent reply	other threads:[~2011-02-23  2:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-10 12:20 Spam and mailing list filtering? Daniel Barlow
2011-02-10 13:33 ` Ben Gamari
2011-02-10 16:00   ` Rob Browning
2011-02-17 13:37 ` James Vasile [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-02-10 15:26 Austin Clements

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sjvmeq8m.fsf@hackervisions.org \
    --to=james@hackervisions.org \
    --cc=dan@telent.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).