Usually, the choice of MTAs are among Exim, Courier, or Postfix. They are overly bloated for simple use! A simple requirement of sending out an email with no extra features like daemon mode, complex aliasing, queueing, database, LDAP, etc.
sSMTP, the simplest of all MTAs. Allows me to do the most important yet simplest thing, to deliver an email to a known destination by forwarding through an SMTP server. It’s not a mailserver per se, but it effectively does what any admin simply needs without all the bloated-ness.
Currently, it’s running on both our TWiki and WordPress setups using Gmail’s service!
sSMTP Configuration
On Debian, it’s easily installed by apt-get install ssmtp. Then we need to modify /etc/ssmtp/revaliases to create a simple alias for the user account.
root:user@domain.tld:smtp.gmail.com:587
The fun begins when we modify /etc/ssmtp/ssmtp.conf. The important parts are as follow…
root=user@domain.tld mailhub=smtp.gmail.com:587 hostname=smtp.gmail.com:587 rewriteDomain= UseTLS=YES UseSTARTTLS=YES AuthUser=user@domain.tld AuthPass=password_here
That’s it! Nothing more nothing less! Pretty easy isn’t it???
TWiki Configuration
On TWiki, just ensure the default values are true. You can check from http://domain.tld/bin/configure
{MailProgram} = /usr/sbin/sendmail -t -oi -oeq
{SMTP}{MAILHOST} =
Or, if you’re familiar with /path/to/twiki/lib/LocalSite.cfg
$TWiki::cfg{MailProgram} = '/usr/sbin/sendmail -t -oi -oeq';
$TWiki::cfg{SMTP}{MAILHOST} = '';
Nice any easy!
WordPress
Am not 100% sure if this is the right way, but it worked for me! You’d need to modify wp-includes/class-phpmailer.php…
var $From = "user@domain.tld"; var $Sender = "user@domain.tld"; var $Mailer = "sendmail"; var $Sendmail = "/usr/sbin/sendmail";
Surely, nothing beats this simplistic SMTP forwarding setup! ![]()
Great Information!!
Hi KwangErn Liew! Thanks for sharing this sSMTP configurations. Truly helps!
-Iya
Hey! Wow what a fantastic article about Smtp Server! Your keen insight into Smtp Server is informative and creative. I look forward to reading other articles you have. Thanks.