postfix only listens on localhost (127.0.0.1)

On a newly installed VPS (Parallells Virtuozzo) running Ubuntu 12.04 LTS I also installed postfix as my MTA. However, it turned out that it only listened on localhost. I checked that "inet_interfaces = all" in main.cf and that my /etc/hosts was up to date with my server’s hostname. The reason was that the machine had sendmail preinstalled and running.

A netstat -an gives: 

tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN

To the solution to this is: 

sudo /etc/init.d/sendmail stop
sudo update-rc.d -f sendmail remove
sudo /etc/init.d/postfix restart

Now netstat -anp show that postfix listens to all interfaces: 

tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 691/master

 

Exit mobile version