By Weldon Whipple <weldon@whipple.org>
LMTP is beneficial when a single incoming e-mail ("envelope") is to be delivered to multiple local recipients. Without LMTP, sendmail just calls the LDA, passing the list of recipients. If the message can't be delivered to one of the recipients for some temporary reason (mailbox full, etc.), the LDA reports to sendmail that the delivery failed (for everybody). If the message is queued and delivery is re-tried later, some recipients might receive the message twice. With LMTP, the status of each recipient's delivery attempt is reported back to sendmail, which now knows exactly who received (or didn't) the message.
LMTP is described in RFC 2033.
To install from ports:
% su # cd /usr/ports/mail/procmail # make
When prompted for test directories, press control-C to cancel the make. We need to edit a header to uncomment a line and enable LMTP:
# cd work/procmail-3.22/
Edit config.h. Search for the commented-out line that defines LMTP:
/*#define LMTP
Remove the leading slash and asterisk (and matching asterisk and slash) and save the file. Then return to the original procmail directory and resume the build:
# cd ../.. # make # make install
The directory /usr/share/sendmail/cf/feature/ should already contain a file named local_procmail.m4, shipped with sendmail. That file lets you use procmail as the local delivery agent, but without LMTP.
FEATURE(`local_procmail_lmtp')
to the mc file, before any lines that begin "MAILER ...".
In the FEATURE line, the first quote is a "back" quote; the second is an apostrophe.
If this is the first time you have modified the sendmail.cf on this FreeBSD server, create a "working" mc file by issuing the following command (as root):
cd /etc/mail; make
The make command will copy freebsd.mc to <hostname>.mc, where <hostname> is your server's host name. (On my mail.whipple.org mail server, the resulting mc file is named mail.whipple.org.mc) Edit the newly created <hostname>.mc and add the local_procmail_lmtp feature as instructed above.
# make # make install # make restart
The first make generates <hostname>.cf from <hostname>.mc; the second copies <hostname>.cf to sendmail.cf; the third restarts the sendmail daemons.
Verify that sendmail still works correctly by sending and receiving some test e-mail and inspecting /var/log/maillog.