Use DMA instead of sendmail

DragonFly Mail Agent (included with FreeBSD 11) allows us to replace sendmail when we only need our server/desktop to send email.


root: sysrc sendmail_enable=NONE
root: service sendmail onestop


root: nano /etc/mail/mailer.conf =>

# Execute dma instead of sendmail
sendmail    /usr/libexec/dma
mailq       /usr/libexec/dma
newaliases  /usr/libexec/dma
rmail       /usr/libexec/dma


root: nano /etc/periodic.conf =>

# Disable some sendmail specific daily maintenance routines
daily_clean_hoststat_enable="NO"
daily_status_mail_rejects_enable="NO"
daily_status_include_submit_mailq="NO"
daily_submit_queuerun="NO"

What remains is the configuration of DMA—here is an example for a Gmail account:

root: nano /etc/dma/dma.conf =>

SMARTHOST smtp.gmail.com
PORT 587
SECURETRANSFER
STARTTLS
AUTHPATH /etc/dma/auth.conf
MASQUERADE '<login-name>@gmail.com

root: echo '<login-name> | smtp.gmail.com: <login-password>'> /etc/dma/auth.conf