I installed Postfix on my server and I'm able to send emails, but can't receive any. I also noticed that I'm unable to telnet to the server with the port 25, from a different computer or from the server itself. I'm getting a "no route to host" message when I try from a distant machine, and it says "connection closed by foreign host" when I try from the server. Here's what I get when I try to list the ports in use :
$ ss -lntu
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
tcp LISTEN 0 0 *:22 *:*
tcp LISTEN 0 0 *:25 *:*
tcp LISTEN 0 0 *:80 *:*
When I try to use an external email checker, I'm also a getting the same "no route to host" error message after entering an email address.
I'm using two external files to parameter Postfix, one with the list of domains I"m expecting emails from, and one with the list of virtual inboxes. Here are a few samples of the main.cf file :
mynetworks = 127.0.0.0/8
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
inet_protocols = all
inet_interfaces = all
virtual_alias_domains = hash:/etc/postfix/virtual_domains
virtual_alias_maps = hash:/etc/postfix/virtual_mailboxes
I also changed the DNS records and created a new MX entry pointing to mail.mydomain.com
Here's my DNS file :
@ A 104.xxx.xxx.xxx
dev A 104.xxx.xxx.xxx
mail A 104.xxx.xxx.xxx
blog CNAME blogs.vip.gandi.net.
imap CNAME mail.mydomain.com.
pop CNAME mail.mydomain.com.
smtp CNAME mail.mydomain.com.
webmail CNAME webmail.gandi.net.
www CNAME webredir.vip.gandi.net.
@ MX mail.mydomain.com. (50)
I've also tried this
$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:http
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Please let me know if I'm missing something, or if you need more information.
Thanks