我在我的Centos邮件服务器上运行postfix和dovecot。
现在我可以将邮件从服务器发送到外部,但是我无法接收来自外部的邮件。
TELNET:当我telnet到我的IP地址到端口21,它连接,但是当它做端口25和110,它不能连接,因此有东西阻止它。
现在,在IPTABLES中,我启用了以下所有端口来允许stream量:80,21,25,110,143。 看到我的iptablesconfiguration如下:
# Generated by iptables-save v1.4.7 on Fri Jul 5 22:08:10 2013 *filter :INPUT DROP [0:0] :FORWARD DROP [0:0] :OUTPUT ACCEPT [30:3200] -A INPUT -p tcp -m tcp --dport 5252 -j ACCEPT -m comment --comment "SSH" -A INPUT -p tcp -m tcp --dport 48001 -m comment --comment "SSH was 5252" -j ACCEPT -A INPUT -p icmp -m icmp --icmp-type 8 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT -A INPUT -p tcp -m tcp --dport 21 -j ACCEPT -A INPUT -m tcp -p tcp --dport 25 -j ACCEPT -A INPUT -m tcp -p tcp --dport 110 -j ACCEPT -A INPUT -m tcp -p tcp --dport 143 -j ACCEPT -A OUTPUT -p icmp -m icmp --icmp-type 0 -m state --state RELATED,ESTABLISHED -j ACCEPT COMMIT # Completed on Fri Jul 5 22:08:10 2013 ~
问题:1.为什么我不能从外部telnet到端口25? (我相信这就是为什么我不能接收来自外部的传入邮件。
注意:我的MXlogging和反向DNS一切正常,我相信如果我可以telnet到端口25和110,我将能够接收来自外部的邮件,或者我错了吗?
PS:我使用以下两个教程设置我的邮件服务器:
后缀: http : //centoshelp.org/servers/mail/postfix-mail-server-on-centos/
DoveCot http://ostechnix.wordpress.com/2013/02/08/setup-mail-server-using-postfixdovecotsquirrel-in-centosrhelscientific-linux-6-3-step-by-step/
编辑: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:3306 0.0.0.0:* LISTEN 1284/mysqld tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 1313/dovecot tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 1313/dovecot tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 1146/vsftpd tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1008/cupsd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2573/master tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 1802/sshd tcp 0 0 127.0.0.1:6011 0.0.0.0:* LISTEN 2038/sshd tcp 0 0 127.0.0.1:6012 0.0.0.0:* LISTEN 2357/sshd tcp 0 0 127.0.0.1:6013 0.0.0.0:* LISTEN 2583/sshd tcp 0 0 0.0.0.0:48001 0.0.0.0:* LISTEN 1767/sshd tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 1313/dovecot tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 1313/dovecot tcp 0 0 :::110 :::* LISTEN 1313/dovecot tcp 0 0 :::143 :::* LISTEN 1313/dovecot tcp 0 0 :::80 :::* LISTEN 1415/httpd tcp 0 0 ::1:631 :::* LISTEN 1008/cupsd tcp 0 0 ::1:25 :::* LISTEN 2573/master tcp 0 0 ::1:6010 :::* LISTEN 1802/sshd tcp 0 0 ::1:6011 :::* LISTEN 2038/sshd tcp 0 0 ::1:6012 :::* LISTEN 2357/sshd tcp 0 0 ::1:6013 :::* LISTEN 2583/sshd tcp 0 0 :::48001 :::* LISTEN 1767/sshd tcp 0 0 :::993 :::* LISTEN 1313/dovecot tcp 0 0 :::995 :::* LISTEN 1313/dovecot
解决scheme – 仔细阅读您的POSTFIX main.cf文件!
我在/etc/postfix/main.cf文件上犯了一个小错误 – 出于某种原因,inet_interfaces = localhost行没有被注释掉,它否决了inet_interfaces = all规则…再次感谢帮助,非常感谢。 现在我也可以telnet到110和143。
它看起来像你的邮件服务器只监听本地主机,而不是你的公共IP: tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
更改configuration,以便监听正确的IP。 一定要正确地做到这一点,因为错误configuration的邮件服务器是常态。