anomy-list

Re: LMTP level filtering helper script

From: Dave Cridland (27484@xyz.molar.is)
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 sanitizer.pl - 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
    programming.

    http://www.btinternet.com/~davecridland/downloads/lmtpserv2.pl

    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
    port.

    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 lmtpserv2.pl to listen to, such as
    /var/imap/socket/lmtp2
    3) Change that in sendmail and in $CONF{lmtp}
    4) Set your anomy path ($CONF{anomyenv}) in lmtpserv2.pl - 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
    testing.
    6) Start lmtpserv2.pl 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.

    Dave.



    hosted by molar.is