Articles Tagged dspam
DSPAM and Postfix, together at last
Posted on December 27th, 2009 19:08:28
by landon
Comments
(So it's been a while since I've blogged, you can blame this latest post on the movie Julie & Julia) Yesterday after getting the umpteenth email offering me cheap Viagra prescriptions, I decided to put some sort of anti spam solution such as Spamassassin. After a bit of research (READ: checking the Ubuntu Postfix guide and running from there), I decided on DSPAM.
The major configuration issues I ran into were when I was trying to set DSPAM up as a filter in Postfix. Eventually I settled on having Postfix deliver mail to DSPAM, which would then deliver to Procmail. The relevant line of Postfix's main.cf is:
mailbox_command = /usr/bin/dspam --deliver=innocent,spam --user $USER
The DSPAM configuration is pretty straightforward, with the Trusted/Untrusted Delivery Agents set to procmail. I may have skipped some details, but there was a lot of changing going on and many changes were made, but it all seems fairly common sense once you figure out where DSPAM is in relation to Postfix and Procmail.
And then in mutt, I borrowed several macros from here.
# DSpam management
macro index "\cx" "<enter-command>set wait_key=no\n<pipe-message>dspam --user landon --class=spam --source=error\n<delete-message><enter-command>set wait_key=yes\n" 'Spam Message'
macro pager "\cx" "<enter-command>set wait_key=no\n<pipe-message>dspam --user landon --class=spam --source=error\n<delete-message><enter-command>set wait_key=yes\n" 'Spam Message'
macro index "\ca" "<enter-command>set wait_key=no\n<pipe-message>dspam --user landon --class=innocent --source=error\n<enter-command>set wait_key=yes\n<save-message>=" 'Non-Spam Message'
macro pager "\ca" "<enter-command>set wait_key=no\n<pipe-message>dspam --user landon --class=innocent --source=error\n<enter-command>set wait_key=yes\n<save-message>=" 'Non-Spam Message'
In addition to this, I have mutt set up to flag spam messages in bright red with this line:
color index brightred default '~h "X-DSPAM-Result:.*Spam"'
And that's it! Now I just need to train it, so for once I'm eagerly awaiting some spam.
EDIT: After tagging 5 or 6 spam messages as false negatives, I've started getting spam sent straight to the spam folder and flagged with bright red in mutt! Success!
