Why ssmtp should be removed from gentoo:
- ssmtp is no longer maintained upstream
- Even its successor, bssmtp has been abandoned. The writer of bssmtp and maintainer of ssmtp said himself "I have now switched back to using Postfix on my laptop."
According to this page by the maintainer, the two advantages of ssmtp are:
- it is light (doesn't matter if it's crap)
- it is easy to configure (it appears that way at first, but it isn't necessarily so, if you check out the gentoo forums)
He continues by saying that it has loads of problems:
- it doesn't fail in a nice way (this is huge, I was running into problem with ssmtp not obeying the rules in
/etc/ssmtp/revaliases; the output in syslog looked the same as a succesful send, but the mail wasn't sent successfully and there is no debugging output or logging whatsoever. Compare that to postfix's excellent logging.)
- it doesn't do local delivery
- it doesn't queue messages.
- there is no nice support for several network environments.
Let me recount my recent experiences. I wanted a simple outgoing mail server. Something that I would allow me to run the following:
echo test |mail -s "test mail sent to external" <a href="mailto:email@example.com">firstname.lastname@example.org</a>
echo test |mail -s "test mail sent to david" david
echo test |mail -s "test mail sent to root" root
and have all 3 message sent to
<a href="mailto:email@example.com">firstname.lastname@example.org</a>. With ssmtp I never got this working after many, many hours of trying. In the end, the last two commands never worked,
/etc/ssmtp/revaliases was not working for some reason. Maybe I goofed, but so what. Getting postfix to work was so damn easy. All I had to do with postfix was change
/etc/postfix/main.cf like so:
relayhost = smtp.vc.shawcable.net
and add a .forward files in the home directory of the root and david users, like so:
echo "<a href="mailto:email@example.com">firstname.lastname@example.org</a>" > /root/.forward
echo "<a href="mailto:email@example.com">firstname.lastname@example.org</a>" > /home/david/.forward
rc-update add postfix default
Presto! It all works! I am sure that there is an easy way to make local mail to all other users on my system get forwarded to gmail as well. Additionally, if I wanted to use gmail's smtp servers instead of shaw's I'm sure that would also be easy.
Let's look at smtp's setup for a bit.
ssmtp.conf there is a "
root=" options. There you can set "who gets all mail for userids less than 1000." The "
mailhub=" option is simple enough and it like the
relayhost option in postfix. The "
hostname=" is the strangest option. You would think that it should be set to the hostname. According to many ssmtp howtos out there, it should be set to an email address. In this case I set it to my email address at shaw (which I don't use), again, according to many howtos. Then there is the
revaliases file. In here you can re-route mail to local accounts to to external email addresses. Too bad it doesn't work. Although it does work for some users apparently. The main thing I didn't like about ssmtp config files were the lack of documentation in them compared to postfix's. I definitely will never be returning to ssmtp now that everything works with postfix (and only took 2 minutes to set up).