Mail - Installing Sendmail with SMTP Auth on FreeBSD (2004)


Benjamin Bryan / b3n.org
2004-07-08

I - Install Sendmail

# cd /usr/ports/mail/sendmail
# make install SENDMAIL_WITH_SASL=yes

A box will popup - select “pwcheck” and deselect everything else.

II - Configure Sendmail

# cd /etc/mail/
# cp freebsd.mc sendmail.mc
# vi sendmail.mc

Add the following lines…

TRUST_AUTH_MECH(`PLAIN LOGIN')dnl
define(`confAUTH_MECHANISMS', `PLAIN LOGIN')dnl
MODIFY_MAILER_FLAGS(`LOCAL', `+S')

# cd /usr/ports/mail/sendmail/work/sendmail-8.12.11/cf/cf/
# sh Build /etc/mail/sendmail.cf
# vi /etc/mail/local-host-names
mail
mail.b3n.org
# killall sendmail
# /usr/local/sbin/sendmail -q30m -bd
(add this to startup as well)

# telnet localhost 25
ehlo localhost

If you see “AUTH PLAIN LOGIN” it worked. Now you can use SMTP authentication to send email.