Re: LMTP level filtering helper script

From: Dave Cridland (
Date: Fri 21 Dec 2001 - 17:08:03 UTC

  • Next message: Dave Cridland: "Re: LMTP level filtering helper script"

    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.

    It now acts as a replacement for - there's a few bits left
    to do, but it appears to work. I've based this on 1.44, but 1.45 should
    work fine with it.

    Thanks to Bjarni for looking at it while I was flummozed by my own

    Major changes from previous version is that this version has removed the
    open2(), and replaced it with (in effect) a fork(), causing quicker
    startup of the sanitizer code - it's already been compiled, in effect.

    It still fork()s, maybe I'll tinker at some point to change that.

    This is very much Alpha code. I'm not risking my email with it yet.

    User configurables are held between "## CONFIG START" and "## CONFIG
    END". You may direct it to, and listen on, either a UNIX FIFO, or a TCP

    Although it says it only does LMTP, I looked through the code breifly,
    and decided that it'll work as-is with SMTP and ESMTP as well. This is
    largely because it takes so little notice of the protocol passing
    through it.

    Sendmail setup is very easy:

    Assuming you're using Cyrus IMAP, you'll probably have:

    Mcyrus, P=[IPC], F=lsDFMnqA5@/:|SmXz, E=\r\n,
                    S=EnvFromL, R=EnvToL/HdrToL, T=DNS/RFC822/X-Unix,
                    A=FILE /var/imap/socket/lmtp

    1) Copy the "/var/imap/socket/lmtp" to the value of $CONF{lmtpmaster}
    2) Choose somewhere else for to listen to, such as
    3) Change that in sendmail and in $CONF{lmtp}
    4) Set your anomy path ($CONF{anomyenv}) in - it'll pull it
    from the ANOMY environment variable if it doesn't know better.
    5) Set $CONF{daemon} to be 1. You want it daemonizing unless you're
    6) Start as a sensible user - probably group mail.
    7) Restart Sendmail.

    Astonishingly, I've actually done this. And even more amazingly, it
    works, in as much as the emails appear in the inbox, *and* don't get
    forgotten about when I fsck up the code. (They just sit in the sendmail
    queue. Which is really handy for testing, actually.)

    Bjarni - just to check you're still reading - your copyright notice in
    1.44 is only 2000, not 2000 - 2001.

    Oh, and Merry Christmas for those who care.


    hosted by