Re: LMTP level filtering helper script

From: Dave Cridland (
Date: Fri 21 Dec 2001 - 18:57:00 UTC

On Fri, 2001-12-21 at 17:08, Dave Cridland wrote:
> On Tue, 2001-12-18 at 10:37, Dave Cridland wrote:
> > On Sun, 2001-12-16 at 13:59, Dave Cridland wrote:
> > > I've knocked together a little Perl script to wrap the Anomy Sanitizer,
> > > and sit in between an LMTP server and the MTA.
> I've done some more work on this.

And yet more - suddenly wondered how useful this was to people not using
stuff like Cyrus. But luckily, procmail (version 3.21, certainly, and
3.22) supports LMTP.

But only as a program (try "procmail -z" in the shell.).

Old version didn't support this, new version does.

Essentially, you can use the same Mailer definition in sendmail as I did
in the last email, but this time, change $CONF{lmtpmaster} to be a
reference to an array of arguments for the program.

Or, a list of arguments in square brackets.

There's some examples in the file, anyway, as usual, on:

Basically, this is good because you can use procmail, which covers most
people, unless their MTA doesn't support LMTP. At which point, you may
as well ignore this.

But hang on... Procmail and Anomy already work together, so what's the

The point is that for every mail, using the Procmail configuration in
the Anomy manual, a brand spanking new sanitizer process has to get
created, which involves compiling several hundred lines of Perl.

For most configurations, if two or more people get delivered the same
email, you'll be scanning, with a freshly compiled sanitizer, the same
email twice.

With this script, this simply doesn't happen - you scan it once, using
the same compilation of, and once alone. The total overhead
compared with normal delivery is 1 process, plus one fork (not exec) per

So this ought to be faster, and leave you with a higher throughput for
fewer processes, under most configurations.

Moreover, if you, like me, pick up lots of email through fetchmail, and
feed it directly into an LMTP server, bypassing your MTA entirely, then
this allows you to do the Sanitization even easier... Or in my case, at
all. :-)


hosted by