[Linux-aus] Anti-spam tips [Was: I just want someone to go down on me first]

Jeff Waugh jdub at perkypants.org
Wed Mar 12 14:33:02 UTC 2003


<quote who="Daniel Stone">

> Apparently bogofilter seeded with results from spamassassin works quite
> well. Basically, just feed it +spam every now and then to keep it happy.

SpamAssassin has bayesian stuff in 2.50 it seems, but I haven't tried it out
yet. I'm using a combination of bogofilter and SpamAssassin with mutt. Bits
from various config files follow:

~/.procmailrc:

  :0 hb
  * ? $BOGOFILTER
  {
      :0 fw
      | $FORMAIL -I "X-Spam-Bogofilter: yes"
  }
  
  :0 fw
  | /usr/bin/spamc
  
  :0:
  * ^X-Spam-Status: Yes
  Trash

So, if bogofilter returns true, I add an X-Spam-Bogofilter header for
SpamAssassin to pick up and score appropriately:

~/.spamassassin/user_prefs:

  rewrite_subject 0
  report_header 1
  use_terse_report 1
  
  header    BOGOFILTER  X-Spam-Bogofilter =~ /yes/
  describe  BOGOFILTER  Message has too many bogons.
  score     BOGOFILTER  5.0

That's my complete user-level SA configuration. I set the daemon up so it
will only do local checks (my MTA does RBL and DNS checks, etc).

In mutt, I have a bunch of helpful macros that let me add/remove bogofilter
information through normal use of my email client:

~/.muttrc:

  # Bogofilter keys and modifications
  
  # Save commands
  macro   index   s   "<enter-command>unset wait_key\n<pipe-entry>bogofilter -N\n<enter-command>set wait_key\n<save-entry>"
  macro   pager   s   "<enter-command>unset wait_key\n<pipe-entry>bogofilter -N\n<enter-command>set wait_key\n<save-entry>"
  
  # Reply commands
  macro   index   r   "<enter-command>unset wait_key\n<pipe-entry>bogofilter -n\n<enter-command>set wait_key\n<reply>"
  macro   pager   r   "<enter-command>unset wait_key\n<pipe-entry>bogofilter -n\n<enter-command>set wait_key\n<reply>"
  macro   index   g   "<enter-command>unset wait_key\n<pipe-entry>bogofilter -n\n<enter-command>set wait_key\n<group-reply>"
  macro   pager   g   "<enter-command>unset wait_key\n<pipe-entry>bogofilter -n\n<enter-command>set wait_key\n<group-reply>"
  macro   index   L   "<enter-command>unset wait_key\n<pipe-entry>bogofilter -n\n<enter-command>set wait_key\n<list-reply>"
  macro   pager   L   "<enter-command>unset wait_key\n<pipe-entry>bogofilter -n\n<enter-command>set wait_key\n<list-reply>"
  
  # harsh delete commands
  macro   index   X   "<enter-command>unset wait_key\n<pipe-entry>bogofilter -S\n<enter-command>set wait_key\n<delete-message>"
  macro   pager   X   "<enter-command>unset wait_key\n<pipe-entry>bogofilter -S\n<enter-command>set wait_key\n<delete-message>"

So when I reply or save a message, it's de-bogofiltered (added to the good
stats). When I "super-delete" a message, it's bogofiltered (added to the bad
list).

All my crap email lands in Trash, which I sort out and bogofilterise every
now and then (bogofilter -S -v < ~/Mail/Trash).

Works really well.

- Jeff

-- 
     "On Tuesday I saw Crouching Tiger, Hidden Dragon with Zack and two     
             ladies whom I presume are gracious." - Seth Schoen             



More information about the linux-aus mailing list