Sending mail through a SSL-only relay server with ssmtp

I sometime feel the need of sending mail directly from my terminal (eg. with mail or reportbug) without having a complete mail-server on my laptop, which is often offline or NATted. For this, I’ve started to use ssmtp, a simple MTA which only delivers local mails to a more powerful remote SMTP-server. I’ve configured it to only communicate over an encrypted TLS connection to well-known port 465, to avoid man-in-the-middle sniffers and firewalls filtering outgoing port 25. This is my configuration (can be tuned via /etc/ssmtp/smtp.conf on Debian-like systems):

root=myuser
mailhub=mail.example.org:465
rewriteDomain=example.org
hostname=myhost.example.org
UseTLS=yes
UseSTARTTLS=no
AuthUser=myuser@example.org
AuthPass=XXXXX
FromLineOverride=YES

Of course, you need an external mail server configured to relay your mail and accepting TLS connections. For this purpose, you could also use a free mail service, like GMail.

Annunci
Sending mail through a SSL-only relay server with ssmtp