Postfix allow only localhost outgoing emails.

A lot of servers don’t need to receive mail, as people nowadays use services like Gmail.

It is simple as changing the inet_interfaces directive in main.cnf from all to

vim /etc/postfix/
inet_interfaces =

You can verify it by testing with nmap, it should say it is a closed port

nmap -p 25

Starting Nmap 6.40 ( ) at 2016-01-28 22:55 EET
Nmap scan report for (
Host is up (0.37s latency).
25/tcp closed smtp

Nmap done: 1 IP address (1 host up) scanned in 0.79 seconds