ssmtp vs. postfix: no contest

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:me@gmail.com">me@gmail.com</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:me@gmail.com">me@gmail.com</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 relayhost in /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:me@gmail.com">me@gmail.com</a>" > /root/.forward
echo "<a href="mailto:me@gmail.com">me@gmail.com</a>" > /home/david/.forward

then,

/etc/init.d/postfix start
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.

In 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).

Comments

I totally agree that ssmtp needs to die. However I don't agree that postfix is the right replacement.
I champion nullmailer as the better replacement.

To match the ssmtp config options:
root=: echo $EMAIL > adminaddr
mailhub=: edit remotes

nullmailer does queue. It does support AUTH on outgoing. There's pending support for SSL. It has nice logging and fails sanely.
It only deliberately doesn't do local delivery.

It is not clear how to set up postfix 'out of the box for a newbe' to make it have send only functionality. I need the send only functionality. I decided to try postfix because I wanted to evolve it into a full blown mail handler. After reading *LOTS* of manual pages and related docs *many* times, it was not clear AT ALL how it should be configured.
With all due respect, your post makes it look simple...but what is not said about other configuration parameters is bothersome, and in my experience a real source of reasons for the simple description not to work. There is no context in your description that describes a known starting point for the other parameters or, how a specific version of postfix and its conf files are set up 'out of the box.'
You do not state what version of Postfix this is or the distro it is working with. Thank God there is a publication date on the article (something almost all posters forget to add). Given this is 2010, postfix has gone through a few versions since then, which really begs the question of the context for your writeup.
SO, I installed ssmtp...had it working within 20 mins. I've been affected by the fact that it does not queue, so I'll probably try nullmailer instead of spending weeks trying to figure out postfix.
It would seem like a good idea to have a 'send only' how to for postfix, but I haven't seen any...
-J

thank you sirs, for the discussion pointing to nullmailer. had to kick ssmtp to the curb, no offline queue was killing me.

I do this, ssmtp is not so good so on all hosts I now use posfix, it's very lightweight when tweaked properly.

http://element.edoceo.com/howto/postfix-nullmailer

ssmtp's revaliases function is not meant to work the same way as /etc/aliases in postfix. ssmtp has no way to direct mail for a user with UID > 1000 to a specific account. The *reverse* alias function does work just fine, it lets you change the from address on mail. However that is not what you wanted :)

Add new comment