HOWTO: configure sendmail with SMTP AUTH as client

HOWTO: configure sendmail with SMTP AUTH as client

Post by Peter W » Fri, 28 Feb 2003 17:22:27



I managed to configure sendmail 8.12.7 that comes with FreeBSD 4.7-STABLE
so that sendmail can authenticate itself against another MTA before
e-mails can be relayed.

Steps:
1. Install Cyrus-SASL v1 from the ports
   #cd /usr/ports/security/cyrus-sasl
   #make
   #cd work/cyrus-sasl-1.5.27/plugins

   Apply the path available at
   http://www.sendmail.org/~ca/email/patches/login.c.clt.p1

   #cd /usr/ports/security/cyrus-sasl
   #make && make install

2. Modify /etc/make.conf to enable the SASL support in sendmail

   SENDMAIL_CFLAGS=-I/usr/local/include/sasl1 -DSASL
   SENDMAIL_LDFLAGS=-L/usr/local/lib
   SENDMAIL_LDADD=-lsasl

3. Make world

4. Add the following lines to your .mc file

   TRUST_AUTH_MECH(`LOGIN PLAIN')dnl You may add more AUTH methods
   define(`confAUTH_MECHANISMS', `LOGIN PLAIN')dnl

   dnl Enable SMART_HOST
   define(`SMART_HOST'), `smtp.yourprovider.com')

5. Edit /etc/mail/access to include

   AuthInfo:other.dom "U:user" "I:user" "P:secret" "R:other.dom" "M:DIGEST-MD5"
   AuthInfo:more.dom "U:user" "P=c2VjcmV0"

   #cd /etc/mail
   #make cf
   #make access.db
   #make install

6. Make sasldb *safe*

   chown root:wheel /usr/local/etc/sasldb
   chmod 600 /usr/local/etc/sasldb

7. Restart your sendmail daemon

   #make restart

The sendmail is ready to serve you! :)

This HOWTO is based on the information from Claus A?mann's article at
http://www.sendmail.org/~ca/email/auth.html. And I got help from Gernot
A. Weber. Thanks to Claus and Gernot!

I'm also copying Giorgos Keramidas, who wants to update the FreeBSD web with
information on configuring sendmail.

If there is anything incorrect or incomplete, please let me know.

Hope this helps.

--
Peter Wu
Powered by Microsoft Windows XP [Version 5.1.2600]

This posting is provided "AS IS" with no warranties, and confers no rights.