|
Configuring ssmtpInstalling ssmtp:
ssmtp needs a bit of configuration to ensure it sends the mail somewhere sensible. Its configuration file is located in /etc/ssmtp/ and is called ssmtp.conf and looks like this: ssmtp.conf
HostnameThe hostname is supposed to be the full name of the machine sending the mail. For plusnet it's <your account name>.plus.com The hostname is supposed to match your reverse DNS name, though it's usually not essential. Rewritedomain"rewritedomain" is the domain name that is added to a local username to turn it into a full email address e.g. "<username>@<rewritedomain>" . If it is commented out ssmtp will set this to the hostname instead. RootThe root alias is the email address that the mail is sent to by default (though not necessarily the address that will appear in the To field). ssmtp can be called with a full email address, in which case it will always send the email to that address with no modification. ssmtp can also be called with just a local username as the destination. If you only supply ssmtp with a username then ssmtp will look for the root alias to find the actual email address to send to. If the root alias only contains a username then ssmtp will add the rewritedomain to make a full email address. I've checked and the SlugOS "ssmtp" does use the supplied username as destination for a userid above 999, for example the "nobody" user. Also you can comment out the root line in which case ssmtp will construct the "to" address from the current username (for cron it's always "root"). MailhubThe mail hub is the machine that you use to send the mail, this would normally be your ISP's "SMTP server". For plusnet that is relay.plus.net It's possible to pass mail to a local machine if you are running a LAN with a mailserver, however if you are running a mailserver you'll probably know far more about email than I do. revaliasesThe revaliases file defines what will appear in the "from" field of the email. It's a good idea to set up an alias to force the "From:" line to a sensible value so edit the revaliases file:
You can add lines for each username that you intend to use. Note that since cron runs as root all reports from cron are addressed from user "root". Set the root's email address to a valid address as if a message bounces this is where it will end up. You need to specify the mailhub again here.ssmtp.conf continued...
FromLineOverrideI don't know what this one does, it doesn't appear in the SlugOS ssmtp.conf but it turns up in other versions on the net. |