notes blog about

I’ve found out that one of the simplest ways how to send emails from scripts running on your workstation is ssmtp (my ex-colleague showed it to me). It’s very easy to install and setup. Basically you just edit one or two lines in ssmtp.conf. However there’s a caveat; the ssmtp does not consider aliases when sending email. So the cron was trying to send email to non existent email address like root@mybox.local.domain. To fix this problem you have to do the aliasing in the mail program by adding lines like these into /etc/mail.rc:

alias root root&
alias postmaster postmaster&
alias username username&

I also put this variable into my crontab