2017-08-16 59 views
1

我已经安装了postfix的外部连接,但在一段时间与它有麻烦。后缀不会允许25端口

我能够连接到本地主机上的端口25,但是当我从外部机器telnet 25端口,连接似乎制成,但随后hungs起来。

我得到的回应:

421无法连接到SMTP服务器xx.xxx.xx.xxx(xx.xx.xx.xxx:25), 连接错误10061连接国外主机关闭。

我必须设置为所有inet_interfaces。

main.cf

soft_bounce = no 
queue_directory = /var/spool/postfix 
command_directory = /usr/sbin 
daemon_directory = /usr/libexec/postfix 
data_directory = /var/lib/postfix 
mail_owner = postfix 
myhostname = mydomain.com 
mydomain = mydomain.com 
myorigin = $myhostname 
inet_interfaces = all 
inet_protocols = all 
mydestination = $myhostname, localhost.$mydomain, localhost 
unknown_local_recipient_reject_code = 550 
mynetworks = 168.100.189.0/28, 127.0.0.0/8 
alias_maps = hash:/etc/aliases 
alias_database = hash:/etc/aliases 
home_mailbox = Maildir/ 


debug_peer_level = 2 
debugger_command = 
    PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin 
    ddd $daemon_directory/$process_name $process_id & sleep 5 
sendmail_path = /usr/sbin/sendmail.postfix 
newaliases_path = /usr/bin/newaliases.postfix 
mailq_path = /usr/bin/mailq.postfix 
setgid_group = postdrop 
html_directory = no 
manpage_directory = /usr/share/man 
sample_directory = /usr/share/doc/postfix-2.10.1/samples 
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES 
smtpd_sasl_auth_enable = yes 
broken_sasl_auth_clients = yes 
smtpd_sasl_type = dovecot 
smtpd_sasl_path = private/auth 
smtpd_sasl_security_options = noanonymous 

master.cf

smtp  inet n  -  n  -  -  smtpd 
submission inet n  -  n  -  -  smtpd 
    -o syslog_name=postfix/submission 
smtps  inet n  -  n  -  -  smtpd 
pickup unix n  -  n  60  1  pickup 
cleanup unix n  -  n  -  0  cleanup 
qmgr  unix n  -  n  300  1  qmgr 
tlsmgr unix -  -  n  1000? 1  tlsmgr 
rewrite unix -  -  n  -  -  trivial-rewrite 
bounce unix -  -  n  -  0  bounce 
defer  unix -  -  n  -  0  bounce 
trace  unix -  -  n  -  0  bounce 
verify unix -  -  n  -  1  verify 
flush  unix n  -  n  1000? 0  flush 
proxymap unix -  -  n  -  -  proxymap 
proxywrite unix -  -  n  -  1  proxymap 
smtp  unix -  -  n  -  -  smtp 
relay  unix -  -  n  -  -  smtp 
showq  unix n  -  n  -  -  showq 
error  unix -  -  n  -  -  error 
retry  unix -  -  n  -  -  error 
discard unix -  -  n  -  -  discard 
local  unix -  n  n  -  -  local 
virtual unix -  n  n  -  -  virtual 
lmtp  unix -  -  n  -  -  lmtp 
anvil  unix -  -  n  -  1  anvil 
scache unix -  -  n  -  1  scache 

netstat的-plnt | grep 25

tcp  0  0 0.0.0.0:25    0.0.0.0:*    LISTEN  10742/master 
tcp6  0  0 :::25     :::*     LISTEN  10742/master 
+0

这个问题属于。 – tadman

回答

0

到smtp端口的传入连接可能被防火墙阻止。

您可以尝试使用工具,如tcptraceoute找到这样的防火墙。因为它涉及到基础设施,每本身不是编程上[服务器故障(http://serverfault.com)

+0

我得到结果:{traceroute到mydomain.com(xx.xxx.xx.xxx),最长30跳,60字节数据包 1网关(xx.xxx)1.784 ms 0.969 ms 1.519 ms 2 xx.xxx.xx .xxx(xx.xxx.xx.xxx) 2.765 ms 1.408 ms 1.804 ms} –

+0

'tcptraceroute'(** TCP ** ....)不是'traceroute' – AnFi

+0

我得到了与tcptraceroute相同的响应,正在运行在CentOS7上。 –