Okay, we were originally having problems with the deliver program connecting
to LMTP via UNIX file sockets.  We thought about going to TCP sockets and
use deliver, but from what I saw in the source code, it may be that deliver
only support UNIX file sockets.

This meant that we needed to dump deliver altogether and get sendmail to
talk to LMTP directly via TCP.  The problem we had here was that we needed
to support plussed users *and* have .forward file support (via the 'w' flag
in the sendmail.cf file).  If the plussed user feature was added to the
sendmail config file, sendmail would strip off the plussed portion  of the
email address and stuff it into a temporary variable.  When the passwd file
check came, the plussed stuff was already stripped off and the check would
be successful, thus allowing .foward files to work.  Sendmail would then
exec deliver, passing the plussed portion of the address (i.e. mailbox) on
the command line so the message would get delivered in the correct place.

However, with LMTP, you have no command line.  Communication occurs over
a UNIX file socket or a TCP socket.  So, if you include the plussed user
feature, it would store the plussed portion of the address in the temp
variable, but nothing would be done with the variable later on... So, all
the mail would end up in the users INBOX (but at least .forward files still
worked).

Our solution was to introduce a new mailer flag.  We wanted to call it '+',
but apparently, sendmail reserved that one for some other use.  So, we call
our new flag 'W'.  What it means is that when the passwd file check occurs,
only use the portion of the username up to the plus sign if it is present.
This means that "adkinss" and "adkinss+test" would only have "adkinss"
checked against the passwd file.  Since the address isn't rewritten, it
would remain as is when passed onto LMTP and delivery would occur as you
would expect with plussed user support.

If anyone is interested in the patch, let me know.  That patch is only 8
lines of real code, so it is really small :)

Now, for the rest of our configuration.  We needed to configure the Cyrus
server to use LMTP via TCP, and we needed to configure Sendmail to do the
same.  Since we aren't running SMTP AUTH just yet, and we are concerned
about access control, and we don't have TCP Wrapper support either, the
best way to run LTMP at this point is with the following line:

    lmtp          cmd="lmtpd -a" listen="localhost:lmtp"

As for our sendmail config, the MC file would contain the following for
the LMTP mailer definition:

    MAILER_DEFINITIONS
    Mcyrus,         P=[IPC], F=lsDFMnqAw@/:|SmXzW, E=\r\n,
                    S=EnvFromL, R=EnvToL/HdrToL, T=DNS/RFC822/X-Unix,
                    U=cyrus:mail, A=TCP [localhost] lmtp

    LOCAL_RULE_0
    Rbb + $+ < @ $=w . >    $#cyrus $: + $1

Note: If you don't have 'listen="localhost:lmtp"' in the cyrus.conf file,
that is, you just have 'listen="lmtp"', then the "A=TCP" section of the
MC file should read "A=TCP $h lmtp" instead.

Anyways, hope that helps others out there with similar delimnas.  I did
notice that there was far less information about running LMTP in TCP mode
in the mail archives than the default unix file socket method.

Scott
--
 +-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+
      Scott W. Adkins                http://www.cns.ohiou.edu/~sadkins/
   UNIX Systems Engineer                  mailto:[EMAIL PROTECTED]
        ICQ 7626282                 Work (740)593-9478 Fax (740)593-1944
 +-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+
     CNS, HDL Center, Suite 301, Ohio University, Athens, OH 45701-2979

Reply via email to