SSMTP send off
If you are unlucky enough to work in a corporate environment where they don't trust your Linux machine to send mail, you probably need to relay to some fucked up Exchange server like http://www.themessagecenter.com/ provide. Poor you.
Since SSMTP sucks, since:
- cron jobs didn't seem to work on ssmtp
- does not provide per user config
- lots of bugs
- the fact that's SSMTP is no longer developed since 2009
I spent a morning migrating from
reason why it took so long as msmtp's "auth on" didn't work and after a LOT of
debugging, I found the solution to be auth login.
So this is my
logfile ~/.msmtp.log auth login from firstname.lastname@example.org host mail.securembox.com user email@example.com password secret
hendry@deb02:~$ grep -v "^#" /etc/ssmtp/ssmtp.conf | grep . root=hendry mailhub=mail.securembox.com AuthUserfirstname.lastname@example.org AuthPass=secret hostname=deb02.jil.org FromLineOverride=Yes
You can tell you have authorisation problem with your relay if your spits out like "550 5.7.1 Unable to relay".
Jan 31 10:49:22 host=mail.securembox.com tls=off auth=off email@example.com firstname.lastname@example.org smtpstatus=550 smtpmsg='550 5.7.1 Unable to relay' errormsg='recipient address email@example.com not accepted by the server' exitcode=EX_DATAERR
The "auth=off" should be a dead giveaway.
With thanks from https://wiki.archlinux.org/index.php/MSMTP.
$ cat test.mail To: firstname.lastname@example.org From: email@example.com Subject: A test Yadda, yadda, yadda
cat test.mail | /usr/sbin/ssmtp -d5 firstname.lastname@example.org
the MSMTP log to compare to:
cat test.mail | msmtp -d email@example.com