cannot telnet 25 port when i test postfix

Issues related to configuring your network
Post Reply
jerry,huang
Posts: 2
Joined: 2015/07/11 16:27:19

cannot telnet 25 port when i test postfix

Post by jerry,huang » 2015/07/24 06:48:54

i'm a new user, when i test my e-mail server link with outlook, it cannot sent email. i telnet 25 port and it shows the following message:
[root@test /]# telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.
[root@test /]#

anyone can help me?

my postfix's main.cf
http://pastebin.centos.org/31271/

dovecot's dovecot.conf
http://pastebin.centos.org/31276/

i post some information below

i'm sure the postfix and dovecot are running here is my proof

  [root@test ~]# service postfix status
  -b (pid 1630) is running...

  [root@test ~]# service dovecot status
  dovecot (pid 2220) is running...

and the port 25,110,143 are listen

[root@test ~]# netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 2220/dovecot
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 2220/dovecot

tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 1630/master
tcp 0 0 :::110 :::* LISTEN 2220/dovecot
tcp 0 0 :::143 :::* LISTEN 2220/dovecot
[root@test ~]#

my iptable and SELinux was shut down

[root@test ~]# 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
[root@test ~]#

[root@test ~]# getenforce
Disabled
[root@test ~]#

the port 110,143 can telnet

[root@test ~]# telnet 127.0.0.1 110
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
+OK Dovecot ready.
quit
+OK Logging out
Connection closed by foreign host.
[root@test ~]# telnet 127.0.0.1 143
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN] Dovecot ready.
....


i must admit that my english is very poor. if there is anything wrong in me. please forgive me and correct me. i would be very grateful to anyone corrections.

nicodemus
Posts: 22
Joined: 2014/07/14 18:20:01

Re: cannot telnet 25 port when i test postfix

Post by nicodemus » 2015/07/24 14:12:33

In your Postfix main.cf, try setting

Code: Select all

mynetworks = 127.0.0.0/24
rather than

Code: Select all

mynetworks = 127.0.0.1/24

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: cannot telnet 25 port when i test postfix

Post by aks » 2015/07/24 18:06:59

Actually that should be 127.0.0.1/8

Whoever
Posts: 1361
Joined: 2013/09/06 03:12:10

Re: cannot telnet 25 port when i test postfix

Post by Whoever » 2015/07/25 01:12:06

Resatrt postfix, then telnet to localhost, port 25, then look in /var/log/maillog. Almost certainly this will reveal the problem.

jerry,huang
Posts: 2
Joined: 2015/07/11 16:27:19

Re: cannot telnet 25 port when i test postfix

Post by jerry,huang » 2015/07/27 01:06:21

thinks , i can telnet 25 port when i modify mynetworks = 127.0.0.1/24 to 127.0.0.0/8 in main.cf

this is my first time to ask question, thanks people for any help to me.

nicodemus
Posts: 22
Joined: 2014/07/14 18:20:01

Re: cannot telnet 25 port when i test postfix

Post by nicodemus » 2015/07/27 12:32:59

jerry,huang wrote:thinks , i can telnet 25 port when i modify mynetworks = 127.0.0.1/24 to 127.0.0.0/8 in main.cf

this is my first time to ask question, thanks people for any help to me.
That's great news. I had a similar problem when I set my test Postfix up a while ago and had also specified 127.0.0.1 as the address. I read the Postfix Basic Configuration article and all the examples refer to the network (such as 127.0.0.0 or 168.100.189.0) but if you want to pin it down to a specific host, you should specify a /32 mask (such as 168.100.189.2/32 or I suppose 127.0.0.1/32). Having said that, you might not be keen to play around, just in case something breaks!

Post Reply