|
藍森林 http://www.lslnet.com 2006年7月28日 12:08
配置postfix郵局服務器。
遇到一個很大的問題。也不知道是啥回事。。。
我用RH as4.0+postfix+cyrus imapd+squirrelmail構建郵局服務器。
在本機上直接用telnet localhost 25正常。。。如下:
[root@RHEL4 ~]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 mail.example.com ESMTP Postfix
EHLO 163.com
250-mail.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH CRAM-MD5 LOGIN PLAIN DIGEST-MD5
250-AUTH=CRAM-MD5 LOGIN PLAIN DIGEST-MD5
250 8BITMIME
quit
221 Bye
Connection closed by foreign host.
但如果用telnet IP地址 25就不行了。
我用的是telnet 192.168.1.254 25,結果提示:
[root@RHEL4 ~]# telnet 192.168.1.254 25
Trying 192.168.1.254...
telnet: connect to address 192.168.1.254: Connection refused
telnet: Unable to connect to remote host: Connection refused
用了域名也不行,我在本機開通了DNS域名服務器,作了www.example.com與mail.example.com等的解析,經檢查,全部正常。也就是說解析沒問題。如下:
[root@RHEL4 ~]# ping www.example.com
PING www.example.com (192.168.1.254) 56(84) bytes of data.
64 bytes from ftp.example.com (192.168.1.254): icmp_seq=0 ttl=64 time=1.64 ms
64 bytes from ftp.example.com (192.168.1.254): icmp_seq=1 ttl=64 time=0.143 ms
--- www.example.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.143/0.894/1.645/0.751 ms, pipe 2
[root@RHEL4 ~]# ping mail.example.com
PING mail.example.com (192.168.1.254) 56(84) bytes of data.
64 bytes from www.example.com (192.168.1.254): icmp_seq=0 ttl=64 time=0.139 ms
64 bytes from www.example.com (192.168.1.254): icmp_seq=1 ttl=64 time=0.141 ms
64 bytes from www.example.com (192.168.1.254): icmp_seq=2 ttl=64 time=0.138 ms
--- mail.example.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 0.138/0.139/0.141/0.009 ms, pipe 2
[root@RHEL4 ~]# nslookup
> set type=mx
> example.com
Server: 192.168.1.254
Address: 192.168.1.254#53
example.com mail exchanger = 11 mail2.example.com.
example.com mail exchanger = 12 mail3.example.com.
example.com mail exchanger = 15 mail.example.com.
example.com mail exchanger = 10 mail1.example.com.
但用telnet mail.example.com 25時,也是提示錯誤,錯誤信息一樣的:
[root@RHEL4 ~]# telnet mail.example.com 25
Trying 192.168.1.254...
telnet: connect to address 192.168.1.254: Connection refused
telnet: Unable to connect to remote host: Connection refused
我也不清楚是啥回事。。。也找不到相關的文檔,希望能有人幫幫忙一下。謝謝各位了。 |
鬱悶。。。我還是搞不到原因。。。有沒有人幫幫我呢?
幫我看一下這是什麼問題呢?
|
netstat -an|grep 25 |grep LIST
把這個命令的結果貼出來你就知道啥原因了 |
運行後,出現如下的信息。請幫忙看一下是啥回事?謝謝。。。
[root@RHEL4 firefox]# netstat -an|grep 25 |grep LIST
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
unix 2 [ ACC ] STREAM LISTENING 8526 /tmp/orbit-root/linc-c38-0-308ace252c574
unix 2 [ ACC ] STREAM LISTENING 5625 private/lmtp |
還有。telnet後的信息提示:
[root@RHEL4 firefox]# telnet mail.example.com 25
Trying 192.168.1.110...
telnet: connect to address 192.168.1.110: Connection refused
telnet: Unable to connect to remote host: Connection refused
查看到的maillog裡的信息為:
[root@RHEL4 firefox]# tail -f /var/log/maillog
Jul 14 14:06:08 RHEL4 imap[3357]: seen_db: user root opened /var/lib/imap/user/r/root.seen
Jul 14 14:06:08 RHEL4 imap[3357]: open: user root opened INBOX.Trash
Jul 14 14:07:08 RHEL4 master[2181]: process 3357 exited, status 0
Jul 14 14:11:34 RHEL4 imap[3358]: accepted connection
Jul 14 14:11:34 RHEL4 master[3369]: about to exec /usr/lib/cyrus-imapd/imapd
Jul 14 14:11:34 RHEL4 imap[3358]: login: RHEL4 [127.0.0.1] root plaintext User logged in
Jul 14 14:11:34 RHEL4 imap[3369]: executed
Jul 14 14:11:34 RHEL4 imap[3358]: seen_db: user root opened /var/lib/imap/user/r/root.seen
Jul 14 14:11:34 RHEL4 imap[3358]: open: user root opened INBOX.Trash
Jul 14 14:12:35 RHEL4 master[2181]: process 3358 exited, status 0 |
原先以為是IP問題。。。
改了IP也是這個問題。。。鬱悶哪。。。
但可以正常收發信。。。所以更奇怪了。。。
|
-->
你的25服務的監聽網絡是127.0.0.1,也就是說,只能通過127.0.0.1訪問25端口,其他網絡地址是不能訪問的。
我的服務器的結果是:
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
這應該就是原因,至於怎麼修改監聽的地址,你再google以下,我也找找。 |
inet_interfaces 你看看這個變量的值是多少
postconf inet_interfaces
default應該是all |
-->
可以了。呵呵。。。真的是監聽的問題。。。
謝謝你。。。
如你所說的。是inet_interfaces這邊的問題,我開放是localhost
而不是all現在改過來就可以了。謝謝你。。。
太感謝你。。。
|
| |