Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

When attempting to telnet postfix from a different host in the same LAN through the FQDN (and thus the LAN's public IP), the following error occurs:

root@mailer:/var/log# telnet 25
telnet: Unable to connect to remote host: Connection refused

Other services can be reached from the exact same host, however:

root@mailer:/var/log# telnet 22
Connected to
Escape character is '^]'.
SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u1

To make matters more intriguing, Postfix can be accessed from outside the LAN:

nunos-mbp:mailog nzimas$ telnet 25
Connected to
Escape character is '^]'.
220 ESMTP Postfix (Ubuntu)

To sum thing up:

a) Postfix (running on / refuses connection from a host in the same LAN (, but only when queried through the FQDN (

b) accepts connections to other services (but Postfix) from

c) accepts connections to all services, including Postfix, from the outside world

If it were a firewall issue, then I believe it would not be possible to connect to any service from through the FQDN / public IP. It ought to be some missing parameter in Postfix, although I haven't found any clear pointers so far.

share|improve this question
You need to check your firewall. –  Michael Hampton Jun 8 '14 at 4:01
If it were a FW issue, don't think i'd be able to reach other ports. –  manchine Jun 8 '14 at 14:48
Did you check it anyway? Why not? –  Michael Hampton Jun 8 '14 at 15:00
Yes I did. iptables is forwarding connections to on port 25. things go wary when the connection happens from within the LAN through the public IP and only when sending mail from one postfix instance to another. –  manchine Jun 9 '14 at 0:13
Many ISPs block port 25 outbound to locations other than authorised mail servers to help prevent spam. This may be what you have. Where is this server located? At a data centre, cloud, at home? –  nOw2 Jun 9 '14 at 6:40

1 Answer 1

Adding to /etc/hosts on solved the issue. This way the public IP is bypassed altogether.

Still wondering why Postfix refuses connections through the public IP of the network when the request is sent from another host in that same network (whereas all other running services accept them).

share|improve this answer
Although this workaround works a treat when telneting, sending a message from a postfix instance on to postfix running on will always take into account the MX records associated with, therefore bypassing /etc/hosts. –  manchine Jun 9 '14 at 0:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.