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 email@example.com host mail.securembox.com user firstname.lastname@example.org password secret
hendry@deb02:~$ grep -v "^#" /etc/ssmtp/ssmtp.conf | grep . root=hendry mailhub=mail.securembox.com AuthUseremail@example.com 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 firstname.lastname@example.org email@example.com smtpstatus=550 smtpmsg='550 5.7.1 Unable to relay' errormsg='recipient address firstname.lastname@example.org 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: email@example.com From: firstname.lastname@example.org Subject: A test Yadda, yadda, yadda
cat test.mail | /usr/sbin/ssmtp -d5 email@example.com
the MSMTP log to compare to:
cat test.mail | msmtp -d firstname.lastname@example.org