Centos – Connection closed by foreign host (postfix)

centospostfixsmtp

Tried to test my smtp server (centos server), I am using telet at centos

When I tried to test using code:

telnet 127.0.0.1 25

Trying 127.0.0.1… Connected to 127.0.0.1. Escape character is '^]'.
220 smtp.mail.forexmart.eu ESMTP Postfix

But when I tried to test using:

telnet localhost 25

Trying ::1…

Connected to localhost.

Escape character is '^]'.

Connection closed by foreign host.

Best Answer

localhost is resolver to IPv6 address ::1 (which is equivalent to IPv4 127.0.0.1) Your postfix maybe listen only on IPv4 address, To listen on IPv6 , you need to specify correct IPv6 address for inet_interfaces directive in /etc/postfix/main.cf file.

line should looks like inet_interfaces = 127.0.0.1, [::1]