multiple LMTP unix sockets: any problems?

2005-05-22 Thread Andrzej Adam Filip

Should I expect any problems with multiple unix LMTP sockets?

On my system packages cyrus-imap makes LMTP socket available to mail 
group. I created second unix LMTP socket available to lmtp group to 
allow *SOME* users submit directly via LMTP.


I use hackish perl script to make Net::SMTP work over UNIX sockets. It 
seems to establish connection (connect OK) but receives no greeting 
(waiting for select). Strace reported similar results for deliver 
(executed with custom configuration file).


--
Andrzej [en:Andrew] Adam Filip [EMAIL PROTECTED] [EMAIL PROTECTED]
---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


SUMMARY: LMTP Unix Sockets

2001-08-27 Thread Scott Adkins

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. Adkinshttp://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



LMTP unix sockets

2001-08-26 Thread Scott Adkins

We are seeing a lot of messages getting deferred in our sendmail logs
when deliver is executed.  Basically, deliver is exitting with EX_TEMPFAIL.
Looking at the cyrus logs, I can correlate most of those failures to the
following message:

 deliver: connect(/var/imap/socket/lmtp) failed: Permission denied

Does anyone know the nature of this problem?  I am not as familiar with
UNIX file sockets as I am with TCP sockets.  I assume, however, that the
listen queue (backlog queue) still works the same for either type of
socket, and since the master process is the one that is in charge and
listening on the various sockets, that maybe I am hitting a wall with
the backlog queue being too small if lots of connections are being made
to imap/pop/lmtp all at the same time.   Am I off base here?

Anybody have any other ideas?

We are going to move from a UNIX file socket to a TCP socket for lmtp
and see if that helps.  I will probably bump up the listen queue to see
if that helps as well.

Scott
--
 +-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+
  Scott W. Adkinshttp://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