Use Postfix instead of Sendmail?

Posted May 3, 2017 18.5k views

I have Sendmail installed for relaying web site emails to Google Apps and have been having random problems very often. If I wish to replace it with Postfix, how do I ensure that Sendmail stops permanently and doesn’t initiate on reboot?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi @cloudnine
Good choice. Simply stop Sendmail and install Postfix, since it’s a drop-in replacement.

sudo service sendmail stop
sudo apt-get install postfix

So unless you’ve made some special calls to sendmail commands, Postfix should take over everything what Sendmail does. You need to re-do the configuration in Postfix, since that is not converted.

  • Thanks. Postfix has worked flawlessly on a couple of other servers.

    One thing, though. If I reboot the system, wouldn’t Sendmail become active again? If yes, what should I change to prevent that from happening?

    • No, because Postfix replaces the configuration, so it should be a drop-in replacement. You shouldn’t need to change anything, anywhere - but if you have special configuration or pipes, then you might need to modify something.

    • Otherwise, simply remove Sendmail before installing Postfix.

      sudo service sendmail stop
      sudo apt-get remove sendmail
      sudo apt-get install postfix
      • Thank you for taking the time to respond with the commands. I couldn’t uninstall Sendmail cleanly on another server, but I am not sure if I used apt-get remove.

      • There is no need to remove sendmail with dedicated command before installing postfix since postfix installation removes sendmail as part of installation process.