for some time now I am not able to reach SMTP on port 25 or 587 on a server of mine from the outside though both ports are open and postfix is listening on them:
$ telnet domain.tld 25
Telnet escape character is '^]'.
Trying *.*.*.*...
telnet: Unable to connect to remote host: Connection timed out
$ iptables -S
-P INPUT DROP
-P FORWARD DROP
-P OUTPUT ACCEPT
-N fail2ban-ssh
-A INPUT -p tcp -m tcp --dport 25 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 587 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 22 -j fail2ban-ssh
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 25 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 110 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 995 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 143 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 993 -j ACCEPT
-A fail2ban-ssh -j RETURN
$ netstat -anpt | grep master
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 1081/master
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 1081/master
Sending mails from the server itself works (through command line & web interface) and fetching mails through IMAP is also possible.
Any suggestions?