[Techtalk] Procmail spam recipes (was simple mail filtering via whitelist)

Akkana Peck akkana at shallowsky.com
Mon Mar 8 17:31:22 EST 2004


John Clarke writes:
> On Sat, Mar 06, 2004 at 10:58:50 -0500, Travis Casey wrote:
> > I've googled already, and found a ton of stuff on blocking spam with
> > procmail... but nothing that showed how to simply do *just* a whitelist.
> 
> How about something like this as a starting point:

As long as we're discussing procmail filtering and spam: I've been
googling for procmail recipes to block messages with attachments of
certain types, or attachments with filenames that include patterns like
.exe and .pif.  I haven't had much luck.  Most of my existing procmail
knowledge centers around using commands like "formail -x
Content-Encoding:" in the procmail recipes, but formail stops at the
first mime type (multipart/mixed if there's a message plus an
attachment) and won't list the types of the attachments.

I could grep the body of the message, but grep isn't smart enough to
pick out patterns like

Content-Type: application/octet-stream;
        name="document.pif"

where the filename is on a different line from Content-Type.

I know programs like spamassassin are smart enough to handle this,
but for various reasons (mostly tied to the lack of a Debian stable
package for it yet) I'd like to find a simpler solution for now.

Of course, I could write a program similar to formail that shows
attachment types, but surely someone must have solved this problem
already ...  Anyone have a recipe?

	...Akkana


More information about the Techtalk mailing list