I'm on Fedora 20 and suddenly started to have this error on newly installed systems. All previous hosts (>70) just were able to so something like:
echo "Hello world" | mail -s "Salute" johndoe@somehost.com
so useful from scripts and so on.
Now command line invocations started to fail with
sSMTP[3144]: Unable to connect to "mail" port 25.
sSMTP[3144]: Cannot open mail:25
The journal of sendmail hints of the command not liking the -bd option ("run as a daemon"). How so ? Of course, if not daemonized, it won't listen on 25/tcp causing the error.
Now, follow the command itself. Instead of running the original sendmail binary, ssmtp has come in the way and supplanted it.
/usr/sbin/sendmail -> /etc/alternatives/mta -> /usr/sbin/sendmail.ssmtp
instead of
/usr/sbin/sendmail -> /etc/alternatives/mta -> /usr/sbin/sendmail.sendmail
Now, ssmtp is as per its man page very simple, intended to replace sendmail in its easiest function - and won't support the -bd option. Thus, no port 25.
Here all breaks - command talking to port 25 will bail out.
I uninstalled (yum remove ssmtp) - and this caused the original sendmail to resume its role - starting the service again brings up port 25 to life.
Now mailing is back in order in the old way.
In another moment I'll take a look to any advantages of ssmtp...