Spam and mailing list filtering?

2011-02-17 Thread James Vasile
On Thu, 10 Feb 2011 12:20:55 +, Daniel Barlow  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


Spam and mailing list filtering?

2011-02-10 Thread Daniel Barlow

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 at 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 at work.com or to:figures at 
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


Spam and mailing list filtering?

2011-02-10 Thread Austin Clements
On Feb 10, 2011 8:33 AM, "Ben Gamari"  wrote:
>
> On Thu, 10 Feb 2011 12:20:55 +, Daniel Barlow  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.
-- next part --
An HTML attachment was scrubbed...
URL: 



Spam and mailing list filtering?

2011-02-10 Thread Rob Browning
Ben Gamari  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


Spam and mailing list filtering?

2011-02-10 Thread Ben Gamari
On Thu, 10 Feb 2011 12:20:55 +, Daniel Barlow  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


Re: Spam and mailing list filtering?

2011-02-10 Thread Austin Clements
On Feb 10, 2011 8:33 AM, Ben Gamari bgamari.f...@gmail.com wrote:

 On Thu, 10 Feb 2011 12:20:55 +, Daniel Barlow d...@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.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: Spam and mailing list filtering?

2011-02-10 Thread Rob Browning
Ben Gamari bgamari.f...@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
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch