On Wed, Dec 17, 2003 at 11:51:26PM -0700, Daniel Crookston wrote:
> Is there a way to add Paul Graham-like filtering to mutt?  Read the article
> on how he does it here:
> 
> http://www.paulgraham.com/spam.html
> 
> and there's an improved algorithm for it here:
> 
> http://www.paulgraham.com/better.html
> 
> I heart Paul Graham
> 
> Dan
> 

Well, mutt doesn't do it's own filtering, that's what things like
procmail are for.  If you want the Paul Graham filtering you'll want a
program like bogofilter.  It can even use improved versions of Graham's
work.  To use it with mutt you would do something like this:

In .procmailrc:
:0fw
| /usr/bin/bogofilter -u -e -p

:0:
* ^X-Bogosity: Yes, tests=bogofilter
junk

In .muttrc:
# bogofilter stuff....
macro index Y "<enter-command>unset wait_key\n<pipe-entry>bogofilter 
-Sn\n<enter-command>set wait_key\n"

macro pager Y "<enter-command>unset wait_key\n<pipe-entry>bogofilter 
-Sn\n<enter-command>set wait_key\n"

macro index X "<enter-command>unset wait_key\n<pipe-entry>bogofilter 
-Ns\n<enter-command>set wait_key\n<delete-message>"

macro pager X "<enter-command>unset wait_key\n<pipe-entry>bogofilter 
-Ns\n<enter-command>set wait_key\n<delete-message>"


This setup will automatically send all messages through bogofilter and
decide whether it's spam or ham.  Spam messages are sent to the junk
folder and ham keeps going through procmail.  If you get a false
positive you hit Y on the message and it is reclassified.  If you get a
false negative you hit X and it is reclassified and deleted.  If you
want the Graham calculations only, just add a -g at the end of the
bogofilter command line.  I've been using this method for a couple of
months now and it works great.  The biggest benefit of bogofilter is
that it is pure C and uses Berkeley DB's so it is fast.  That helps a
lot on a Pentium 266.

-- 
--------------------------------+-----------------------------------
Byron Clark                     |       http://www.byronandannie.net
[EMAIL PROTECTED]         | 
--------------------------------+-----------------------------------
GnuPG Fingerprint: 0365 6979 6C3E BC0C 56C0 FB7F 12B3 75DD 042B EA68

Attachment: pgp00000.pgp
Description: PGP signature

____________________
BYU Unix Users Group 
http://uug.byu.edu/ 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to