sSMTP and gmail

Tags: freebsd, software

Published on
« Previous post: Hyppolyta (or: How to scan your book … — Next post: Opera and libnpp.so »

According to its man-page, ssmtp is a “send-only sendmail emulator”, hence allowing your machine to send, say, status reports via mail without the need for sendmail or any other MTA.

ssmtp is simple to use, simple to install and works very well. I use it on my file-server: Without further ado, several scripts and programs (such as smartmoontools) can now send me their reports directly to a given mail address.

FreeBSD users just cd to /usr/ports/mail/ssmtp and do the usual make install clean. Afterwards, this is how your ssmtp.conf (located in /usr/local/etc/ssmtp/) should look like:

root=catchall@example.net
mailhub=smtp.gmail.com:587

rewriteDomain=example.net
hostname=mail.example.net

FromLineOverride=YES

UseSTARTTLS=YES
AuthUser=your\_gmail\_account@gmail.com
AuthPass=swordfish

No, my password is not “swordfish”. The above settings work very well for my gmail account, providing an easy and secure way to get status reports. To let the script send you mails, just add a MAILTO=me@example.net statement to your crontab, for example.