I had been handling $random@stonehenge.com by letting postfix deliver to my procmailrc, which fired up a separate Perl invocation to sort and deliver the mail for each incoming email. 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 in one payload. 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 Mail::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 preforking 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.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.


In reply to Spam Fighting moved from MUA to MTA - success! by merlyn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.