sSMTP is an extremely simple MTA to get mail off the system to a mail hub. It contains no suid-binaries or other dangerous things – no mail spool to poke around in, and no daemons running in the background. Mail is simply forwarded to the configured mailhost. Extremely easy configuration.

This is ideal for web servers to avoid running MTA daemons like sendmail, Exim and Postfix which use up resources on the server.

Install sSMTP (Note: Any previously installed MTA will be removed)

apt-get install ssmtp

Configure the server (sudo nano /etc/ssmtp/ssmtp.conf)

mailhub=mail.example.org
FromLineOverride=YES

Replace mail.example.org with the external mail server that you want to relay all mail to.

If you would like to relay through Google Mail servers, change these configuration values:

mailhub=smtp.gmail.com:587
UseSTARTTLS=Yes
AuthUser={username}
AuthPass={password}
FromLineOverride=YES

Replace {username} with your Gmail username and {password} with your Gmail password.

That’s all! sSMTP doesn’t run as service so there’s no restart required. sSMTP creates a link to /usr/sbin/sendmail which most programs use by default to send mail including PHP.

Pin It on Pinterest

Share This