unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Spam and mailing list filtering?
@ 2011-02-10 12:20 Daniel Barlow
  2011-02-10 13:33 ` Ben Gamari
  2011-02-17 13:37 ` James Vasile
  0 siblings, 2 replies; 5+ messages in thread
From: Daniel Barlow @ 2011-02-10 12:20 UTC (permalink / raw)
  To: notmuch


I've been running notmuch for only a couple of days now and am still
getting to grips with it, but I am very very happy to be back in Emacs
again for mail after two years in the Thunderbird wilderness.  So, thank
you.  

I like my mail tagged on reception so that my mailing lists and spam
only show up when (or if) I actually want to read them.  To this end
I've done as I suspect most people do: wrote a small shell script that
runs 'notmuch add' and then a succession of 'notmuch tag' to identify
the mails I'll deal with later.  For example

notmuch new
notmuch tag +inbox --  to:dan and is:unread
notmuch tag +office-work  --  folder:Work/Shared.office and is:unread
notmuch tag +tech-work --  folder:Work/Shared.technotes and is:unread
notmuch tag +work -- folder:Work and is:unread
notmuch tag +work -- from:office@work.com and is:unread
notmuch tag +ruby-talk -inbox -- to:ruby-talk and is:unread
notmuch tag +lrug -inbox -- to:ruby-talk and is:unread
notmuch tag +work-figures -inbox -- '(from:figures@work.com or to:figures@work.com) and is:unread


My questions 

1) (How) can I filter on the X-Spam-Bar header to chop out spam and
suspected spam?

2) Is there any way (actual or planned) to filter on X-List-Id or
similar so that I can filter mailing list stuff more accurately

3) Ditto for filtering on Envelope-To, which I know is not a real
SMTP header but appears in my mail archives anyway


-dan

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

* Re: Spam and mailing list filtering?
  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
  1 sibling, 1 reply; 5+ messages in thread
From: Ben Gamari @ 2011-02-10 13:33 UTC (permalink / raw)
  To: Daniel Barlow, notmuch

On Thu, 10 Feb 2011 12:20:55 +0000, Daniel Barlow <dan@telent.net> wrote:
> My questions 
> 
> 1) (How) can I filter on the X-Spam-Bar header to chop out spam and
> suspected spam?
>
I simply run new mail through bogofilter in my sorting script and tag
junk with a junk tag. I then add "not tag:junk" to each of my saved searches.
 
> 2) Is there any way (actual or planned) to filter on X-List-Id or
> similar so that I can filter mailing list stuff more accurately
> 
There have been talks of adding support for indexing arbitrary headers
although no one has produced any code as far as I know. Patches welcome.

Cheers,

- Ben

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

* Re: Spam and mailing list filtering?
@ 2011-02-10 15:26 Austin Clements
  0 siblings, 0 replies; 5+ messages in thread
From: Austin Clements @ 2011-02-10 15:26 UTC (permalink / raw)
  To: Ben Gamari; +Cc: notmuch

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

On Feb 10, 2011 8:33 AM, "Ben Gamari" <bgamari.foss@gmail.com> wrote:
>
> On Thu, 10 Feb 2011 12:20:55 +0000, Daniel Barlow <dan@telent.net> wrote:
> > My questions
> >
> > 1) (How) can I filter on the X-Spam-Bar header to chop out spam and
> > suspected spam?
> >
> I simply run new mail through bogofilter in my sorting script and tag
> junk with a junk tag. I then add "not tag:junk" to each of my saved
searches.

One of my plans for after the custom query parser patches get reviewed is to
make it possible to exclude certain tags from queries by default, unless the
query specifically mentions the tag. This should make it easier to handle
spam tags like this.

[-- Attachment #2: Type: text/html, Size: 876 bytes --]

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

* Re: Spam and mailing list filtering?
  2011-02-10 13:33 ` Ben Gamari
@ 2011-02-10 16:00   ` Rob Browning
  0 siblings, 0 replies; 5+ messages in thread
From: Rob Browning @ 2011-02-10 16:00 UTC (permalink / raw)
  To: Ben Gamari; +Cc: notmuch

Ben Gamari <bgamari.foss@gmail.com> writes:

> I simply run new mail through bogofilter in my sorting script and tag
> junk with a junk tag. I then add "not tag:junk" to each of my saved searches.
>  
>> 2) Is there any way (actual or planned) to filter on X-List-Id or
>> similar so that I can filter mailing list stuff more accurately

Also note that if you're already filtering via procmail or similar, I
believe you should be able to use notmuch-deliver to add tags based on
the headers it finds.

Alternately, if you already deliver all spam to a particular folder, the
new "folder:" support might help.

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4

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

* Re: Spam and mailing list filtering?
  2011-02-10 12:20 Spam and mailing list filtering? Daniel Barlow
  2011-02-10 13:33 ` Ben Gamari
@ 2011-02-17 13:37 ` James Vasile
  1 sibling, 0 replies; 5+ messages in thread
From: James Vasile @ 2011-02-17 13:37 UTC (permalink / raw)
  To: Daniel Barlow, notmuch

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

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

end of thread, other threads:[~2011-02-23  2:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2011-02-10 15:26 Austin Clements

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