Problem using Postfix with Sendmail

Postfix is a drop-in sendmail replacement that includes its own sendmail binary (see the foot of this post). I'm honestly surprised apt let you do this, I thought they were package conflicted.

Anyway, to fix:

sudo apt-get purge sendmail
sudo apt-get install --reinstall postfix
sudo /etc/init.d/postfix restart

Proof that sendmail on my system is provided by postfix:

$ dpkg -S `which sendmail`
postfix: /usr/sbin/sendmail

If you're still having problems, here's how you can find out what program (and which package) is hogging port 25:

$ sudo netstat -pel | grep smtp
tcp 0 0 *:smtp *:* LISTEN root 8487 2212/master

$ # Then we use the 2212 from that in the following to get the package:
$ dpkg -S "$(sudo ps ux | grep 2212 | awk '{print $NF}')"
postfix: /usr/lib/postfix/master

In my case that's postfix. In your case I expect to see something else. Nuke it from orbit.


For me the solituion was a variant of Oli answer in an Ubuntu13:

Error: fatal: bind 0.0.0.0 port 25: Address already in use

Sendmail purge didn't work:

Package 'sendmail' is not installed, so not removed

So I tried:

service sendmail stop
sudo apt-get install --reinstall postfix

and worked!


This solved me on the same issue.

service sendmail stop
service postfix restart
service sendmail start

As seen at Postfix start error Port 25: Address already in use