I am having a problem that's driving me up the wall. I have a server, where after several attempts at various iptable rules, I have flushed iptable rules and set default policy to accept.
The output of $ sudo iptables -L
:
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
I do have postfix listening on the port as can be found on $ sudo netstat -tulnp
:
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 9639/master
When I run nmap from my local machine $ sudo nmap -p 25 <server-ip>
:
PORT STATE SERVICE
25/tcp filtered smtp
When I run nmap from the server itself $ sudo nmap -p 25 localhost
:
PORT STATE SERVICE
25/tcp open smtp
When I telnet to the server from my local machine, the connection timesout. But if I telnet on the server itself $ telnet localhost 25
then I see:
Connected to localhost.
Escape character is '^]'.
220 <server-domain> ESMTP Postfix
I'm really at my wits end. I found some other posts on this site and other stack-exchange ones about similar issues, but the problem there seemed to be that the service was not running and listening on port 25. But as you can see from the netstat command, the postfix process is listening to port 25 on this server.
Can anyone please give me pointers on what to try next?
Oh also tried $ sudo tcpdump -n port 25
while the connection attempt was made. But there were no packets captured. But tcpdump captured packets when I connected from the server itself $ telnet localhost 25
.