Disclaimers: This may primarily be of interest to Unix geeks. It's quite possible to use TMDA with other operating systems, though. Also, TMDA is no longer a system that use personally. Instead, I've been extremely happy with SpamAssassin, which seems to block at least as much spam as TMDA with less configuration and complexity hassle.

I recently started using a new spam handling system which has reduced the number of spam messages in my box to one or two or day. About another fifty get correctly identified and handled as spam for me. I've accomplished this using some software called TMDA, the "Tagged Message Delivery Agent".
Here I'll explain some how my TMDA set up works. Part of my solution also involves using procmail to filter my mail. For the Big Picture, check out this flowchart of how my incoming mail is handled.
The central feature of TMDA is that it is based around the idea of "white lists", only allowing mail from address that you explicitly allow, rather than trying to guess all of the formats of spam that I should try and block.
It takes very little effort to manage my TMDA white list. I started by adding everyone in my addressbook to it, plus all the domains we host at Summersault. People I e-mail are automatically added to the whitelist. People who e-mail me me have to confirm the first e-mail they send me from an address. So far no one has complained about this.
Mailing lists need to be handled exceptionally because they are not smart enough to reply to my confirmations like humans are. I either filter them with procmail before TMDA comes into the picture, or manually add the addresses to my whitelist file.
Lately I've been trying another method for handling mailing lists, using the GMANE service. GMANE will take just about any mailing list I want to subscribe to and make it look like a newsgroup. This is convenient for me because a lot times I subscribe to list, ask a question, hang out for a bit an unsubscribe. By using GMANE, I don't have to bother subscribing or unsubscribing. I can always get to the list to post or read the the archives as e-mail. GMANE also uses SpamAssassin to prevent spam from getting posted on the lists, and provides the me ability to post messages with an encrypted address (which is powered by its own installation of TMDA). This further reduces the amount of spam I get.
To make sure my e-mail address is encrypted when posting though GMANE, I simply make sure the X-Archive:
encrypt header is added to my messages.
There is a fear that goes along with using TMDA: But what if someone sent me an e-mail I really want to read, but they didn't reply to the confirmation message?. These messages are in a pending queue on your mail server, and TMDA has a number of options for managing it. Here's what I end up doing:
In the typical case, I let the message sit there for a couple days giving the person a chance to reply. Then, I get an e-mail report of all the mail that has been in pending queue for at least 48 hours that I haven't already seen. This is usually a quick scan of the subject lines of 50 or spams I got three days ago. For that, I use a cron script that looks like this:
23 3 * * * tmda-pending -TCb -O 48h | mail -E -s "TMDA new in pending" mark > /dev/null 2>&1
The format of the messages looks like this:
1047224985.73004.msg Etkili Reklam Reklam Malýnýzý Sattýrýr... 1047226086.74191.msg egsbtech@marketdepots.com Daily Messages Online 1047228021.76472.msg ¹«ÃÊ (±¤°í)¹Ù²î´Þ¸°½Å¹ß,Àü±âÀÚÀü°Å ¿ÀÅä¹ÙÀÌÅ©·Î ÃâÅð±ÙÇϼ¼¿ä 1047228227.76675.msg alex@seed.net.tw ¶}±Ò·s¥@¬ö-·s¾÷·| 1047228236.76693.msg alex@seed.net.tw ¶}±Ò·s¥@¬ö-·s¾÷·
TMDA offers a more verbose format which displays more of the headers and a "mailto" link to delete messages from your e-mail program, but I prefer this terse report format. To manually release a message from the pending queue, I use a syntax like this:
tmda-pending -rb 1047228236.76693.msg 1047228227.76675.msg
That causes the messages to show up in my Inbox, and the senders to be whitelist-ed.
I also have a nightly cron script to delete mail in the pending queue that is older than 30 days. I don't have this one e-mailed to me, since I can't get back the e-mail at this point anyway:
44 3 * * * tmda-pending -TbdO 30d > /dev/null 2>&1
Sometimes I like to manually peek in the pending queue when I suspect some recently sent piece of mail has
landed there. Here I use the tmda-pending tool much I did in my cron script before. The way I invoke
it here means "show me all the mail in the pending queue that I haven't already seen". TMDA is
smart enough not show me these messages again when it sends its next report. Here's the command I use for that:
tmda-pending -TCb
TMDA keeps some handy logs of what it does. Here's are some tips I use to manage rotating them so they don't grow too large.
So, it may seem that using TMDA as I do is harder than it needs to be. It does take a little time to get set up, and it feels a bit geeky to use. However, it's so nice to be getting near-zero spams in my Inbox now. Once that TMDA was setup, I spend almost no time tinkering with it. For most part, it "just works".
I don't consider TMDA to be the Ultimate Solution for handling spam. Since Paul Graham wrote his Plan for Spam, there has been a lot of interest and development around the idea of Bayesian spam filtering. This is a kind of system that "learns" what is spam as you define it, by giving it examples of what is and isn't spam to look it. Apple uses something like this in their Mail.app program and I believe the Mozilla project is incorporating a flavor of this into their mail program. I'm interested in trying this kind of system more myself.
A special thanks to Chris Hardie for introducing me to TMDA and helping get this set up.
The flowchart was made with OpenOffice.