If you don't need a full blown mail server, and use Gmail for almost everything, this guide is for you. With SSMTP you can have a quick and easy way to get automated mail off your machine and to a mail hub.
Installation and Setup
To install SSMTP, you can just use Pacman:
pacman -S ssmtp
To configure SSMTP, you will have to edit the following files.
In /etc/ssmtp/ssmtp.conf enter:
firstname.lastname@example.org mailhub=smtp.gmail.com:587 rewriteDomain= email@example.com UseSTARTTLS=YES AuthUser=youraccount AuthPass=yourpasword FromLineOverride=YES
Replacing youraccount with your Google username.
Make sure to change the file permissions so that users on your system cannot see your gmail password
chmod 600 /etc/ssmtp/ssmtp.conf
In /etc/ssmtp/revaliases enter:
And this is it. If you want to test it, you can simply issue at the terminal prompt:
echo test | mail -s "testing ssmtp setup" USERNAME@SOMEDOMAIN.COM
Where USERNAME@SOMEDOMAIN is an address that you can check, or somebody is willing to check for you.
As an alternate method for sending emails, even using a Gmail alias, you can use a text file, using the following syntax:
To:USERNAME@SOMEDOMAIN.COM From:firstname.lastname@example.org Subject: Test This is a test mail.
Save it as, for example, test and then run:
ssmtp email@example.com < test
Notice that you can use any alias email address you have on Gmail (although it doesn't seem to work with the Hotmail one I have).