Postfix and open port 25 but this port is not showed open with nmap

0

From the following post :

Postfix issue : iptables rules and can't receive email from outside

the solution suggested is working (can receive email from outside) but I don't understand why nmap (from outside on my SMTP server) doesn't show the port 25 opened, after applying the iptables rule to open this port. Indeed, I get with nmap :

Not shown: 994 closed ports
PORT    STATE    SERVICE
22/tcp  open     ssh
80/tcp  open     http
135/tcp filtered msrpc
139/tcp filtered netbios-ssn
443/tcp open     https
445/tcp filtered microsoft-ds

As you can see, port 25 is not displayed as opened, are these results normal ?

Thanks

UPDATE 1 :

I apply the following rule (to immediately receive email from outside) :

iptables -I INPUT 5 -p tcp -m tcp --dport 25 -j ACCEPT

and it works just after applying this rule.

Then, with the result of iptables -L :

# iptables -L
Chain INPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ssh
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:smtp
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:https
REJECT     tcp  --  anywhere             anywhere             reject-with tcp-reset

Then I do nmap and I get :

Not shown: 994 closed ports
PORT    STATE    SERVICE
22/tcp  open     ssh
80/tcp  open     http
135/tcp filtered msrpc
139/tcp filtered netbios-ssn
443/tcp open     https
445/tcp filtered microsoft-ds

youpilat13

Posted 2016-08-28T11:25:21.690

Reputation: 63

Answers

1

If you can receive mail from the internet then port 25 should be visible in the nmap scan. You should post the output of iptables -L as well as the nmap command you used. Maybe you scanned the wrong IP address.

Peter Skarpetis

Posted 2016-08-28T11:25:21.690

Reputation: 181