CONFIGURING YOUR MTA
The trick is to tell your SMTP server to deliver to different LMTP sockets based on domain name...
SENDMAIL
Many thanks to Igor Brezac, Claus Assman, and Neil Rickert for all of their help! I couldn't have figured this one out without you!
I'm not a sendmail expert by any means, but this works for me...
Near the top of your sendmail.mc (after OSTYPE and DOMAIN), add:
FEATURE(`mailertable',`hash /etc/mail/mailertable')dnl
Then at the bottom of sendmail.mc add:
MAILER_DEFINITIONS
Mlmtp, P=[IPC], F=lsDFMnqA@/:|SmXz, E=\r\n,
S=EnvFromL, R=EnvToL/HdrToL, T=DNS/RFC822/X-Unix,
A=FILE $h
Then make a mailertable in /etc/mail/mailertable that looks like this:
domain1.com lmtp:/var/imap/domain1.com/socket/lmtp
domain2.com lmtp:/var/imap/domain2.com/socket/lmtp
Now make your mailertable hash:
# makemap hash /etc/mail/mailertable < /etc/mail/mailertable
And make your sendmail.cf:
# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
NOTE: Creating sendmail.cf may be different on your system. Two caveats I know of:
- If you don't have a line like:
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
in your sendmail.mc, then you'll have to include it on the command line (I'm not sure how off hand, see the m4 man page)
- Some versions of sendmail expect to see sendmail.cf in /etc/sendmail.cf - look and see where yours is and make sure you put it in the right place.
Restart sendmail:
#/etc/init.d/sendmail stop
#/etc/init.d/sendmail start
And that's it! Test it with:
# /usr/lib/sendmail -bt
...
> /parse user@domain1.com
...
mailer lmtp, host /var/imap/domain1.com/socket/lmtp, user phil
> ^D
#
If you see something like that, you're all set!
POSTFIX
My friend has this working, and I'm waiting on his configs to post them. Stay tuned.
QMAIL
I may get to this one day, but this is low on the priority list.
Last Updated: 06/23/02
This page is © Phil Dibowitz 2001 - 2004