Could not open connection to the host on port 25: connect failed (POSTFIX)

Could not open connection to the host on port 25: connect failed (Postfix)

Are you getting this error when trying to connect to your Postfix server from a remote computer ?
Here are the steps that resolved this issue for me:

1.  Make sure DNS is fine and that you can ping the mail server from the remote Computer.

2.  Make sure that there is no firewall blocking the connections.

3.  Make sure that your ISP is not blocking port 25

4.  Make sure that you can telnet the mail server locally (on the same computer).

5.  Most importantly , Make sure you set up the  inet_interfaces flag accordingly:
    #inet_interfaces = all
    #inet_interfaces = $myhostname
    #inet_interfaces = $myhostname, localhost

6.  Make sure your MX record is set
Let's share thisShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn