MTA: Sendmail

SMTP authentification

by ross at 07:22:47 on October 28, 2011

Install:

# cd /usr/ports/security/cyrus-sasl2-saslauthd
# make install clean
# rehash

Options for cyrus-sasl-saslauthd:

  • Leave at their defaults

Add to /etc/rc.conf:

saslauthd_enable="YES"

Create /usr/local/lib/sasl2/Sendmail.conf:

pwcheck_method: saslauthd

Start saslauthd:

# service saslauthd start

Edit /etc/make.conf:

SENDMAIL_CFLAGS=-I/usr/local/include -DSASL=2
SENDMAIL_LDFLAGS=-L/usr/local/lib
SENDMAIL_LDADD=-lsasl2

Rebuild sendmail:

# cd /usr/src/lib/libsmutil
# make cleandir && make obj && make
# cd /usr/src/lib/libsm
# make cleandir && make obj && make
# cd /usr/src/usr.sbin/sendmail
# make cleandir && make obj && make && make install

Add to /etc/mail/YOUR-HOSTNAME.mc:

TRUST_AUTH_MECH(`GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN')
define(`confAUTH_MECHANISMS', `GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN')

Restart sendmail:

# cd /etc/mail
# make cf
# make install
# make restart

Now sendmail will relay mail for known users.

 

Comments