Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

merlyn (47)

AOL IM: realmerlyn (Add Buddy, Send Message)
Yahoo! ID: realmerlyn (Add User, Send Message)

See my home page [].

Journal of merlyn (47)

Tuesday November 04, 2003
10:32 AM

Spam Fighting moved from MUA to MTA - success

[ #15555 ]
I had been handing $ by letting postfix deliver to my procmailrc, which fired up a separate Perl invocation to sort and deliver the mail for each incoming. And test for spam.

The problem is the MIRVs. A lot of mail gets addressed to thereto@stonehenge, barney@stonehenge, merlyn@stonehenge, for about 10 addresses. And this type of spam seems to have greatly increased in the past few months. A burst would come in, and for the next two minutes, I was splitting and forking and SpamAssassin-ing, and loadav would hit 3 or so, and my sublease customers were complaining.

So yesterday, I bit the bullet, and learned about Amavisd, a Perl daemon built around Net::Server, that could pull in SpamAssassin and some virus checkers. I carefully read the "README.postfix" file included in the distro, and set up everything.

Wow, what a difference. Now my postfix/amavisd MTA checks for spam once for the MIRVs, without forking, instead of 10 times with a lot of forking going on. My loadav has never exceeded 0.9! Hooray. Success.

I'm getting about 1 MIRV a minute. Ouch.

My only concern is that the amavisd is started and stopped outside the normal postfix engine, so I'm concerned about what happens when it goes down. (Postfix will just stop, but I won't be around to notice.) I'm thinking of a cronjob entry to just keep restarting it every half hour or so, just in case it fries.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Just do your entire smtpd in perl [].

    There's two pieces left to the qpsmtpd puzzle - firstly to have a pure perl server (which I've just checked into CVS, but it's a little premature yet - help would be most welcome since this is an area you have lots of experience in), and secondly to have a pure perl delivery system (perhaps delivering to procmail, but also needs to support onward relaying).

    Sorry, I hate it when people like me suggest a completely different solution to the one you just found that works per
    • There are times when I want a stick shift, and times when I want an automatic.

      For email delivered to $, I want an automatic. If it was just my own mail, I'd be happy to play with new tools, and take the risks (and rewards of such).

      I think you can both relate, and agree.

      • Randal L. Schwartz
      • Stonehenge
  • have you tried MailScanner (yet another Perl-wrapper for SpamAssassin) I enjoy it very much and it has auto-recycling and multiple instance and multiple possible MTA. -- dominix