KBD

Keith Devens .com

Saturday, November 22, 2008 Flag waving
That's all I have to say about that. – Forrest Gump

Archive: April 22, 2005

← April 21, 2005April 23, 2005 →

Daily link icon Friday, April 22, 2005

  1. My Way News: Woman in Wendy's Finger Case Arrested. This story is bizarre.

    Update: One more article.

       (0)
  2. lgf: Army Sgt. Haab Won't Be Prosecuted. Thank God. Sanity!

       (0) Tags: [Opinions/Politics]

How to create a procmail spam blacklist

Procmail just saved me from my big spam problem.

On Windows I use K9, which I highly recommend, but since I switched to Ubuntu I haven't had a spam filter (at least, besides what TextDrive does for everyone at the server level, which is pretty good). The vast majority of my spam is sent to bogus e-mail addresses at my catch-all. In K9 I had a blacklist for those addresses, which were stable (i.e. not random. It seems someone generated bogus addresses at my domain and sold them as part of a list), and K9 filtered at the client-side.

Since TextDrive is rolling out a new mail system soon complete with server side DSPAM (which is supposed to be great), I didn't want to go through the trouble of installing a client-side spam filter on Linux. But just recently I started getting over 1000 messages a day, mostly large multiples of the same messages (even to the same address!), all to addresses that I previously had blacklisted. So, I figured I'd at least put that blacklist back in place. Here's how I did it in procmail:

In .procmailrc:

INCLUDERC=$HOME/.procmailblacklist

And .procmailblacklist:

LINEBUF=4096

:0
* ^TO_(adkins|\
alvarez|\
aguilar|\
andrews|\
arez|\
armstrong|\
#... for about 300 more addresses
woods)\
@keithdevens\.com
/dev/null

At first I was exceeding the default LINEBUF, which is 2048, but luckily you can set it, so I bumped it up to be large enough to hold the whole regex in memory, based on the size of .procmailblacklist. I hope this will save someone else a little time in setting up a similar blacklist.

Update: What's fun is I can watch this work by monitoring procmail's log file. Just in the short time this has been in place it's already blocked about 140 messages. Update: make that >200. Update: >400. I was going to go to bed tonight without having put this filter in. I'm glad I didn't do that.

Procmail resources

← April 21, 2005April 23, 2005 →
November 2008
SunMonTueWedThuFriSat
 1
2345678
9101112131415
16171819202122
23242526272829
30 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 4 posts

Recent comments XML

Calif. Supreme Court to take up gay marriage ban

I would argue the point is not​definitional.  While the word​marriage is su...

Justin: Nov 20, 4:37pm

Java join function

Meh, don't have null strings in​your string arrays imo, but you're​welcome ...

Keith: Nov 19, 7:51pm

Girls, please don't get breast implants

sorry but another thing i have to​make a comment on about you​men...the men...

happynow: Nov 17, 11:36pm

Books by Vincent Cheung

to all Cheung​fans:

read:

http://www.progin​osko.com/aquascum/cheung.h...

Zamir: Nov 16, 9:07am

Generated in about 0.051s.

(Used 7 db queries)

mobile phone