我已经在CentOS机器上安装了Postfix。我可以使用很好地将邮件发送到本地帐户mutt
,但是当我尝试将邮件发送到[email protected]之类的远程邮件时,我不明白为什么我什么都收不到。这是我的main.cf
:
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = server.example.com
mydomain = example.com
myorigin = $mydomain
inet_interfaces = all
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
unknown_local_recipient_reject_code = 550
mynetworks = 192.168.200.0/24, 127.0.0.0/8
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
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.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
在邮件日志中,我找到了这些:
Jan 22 14:33:15 server postfix/qmgr[5025]: 316FEBF65E: from=<[email protected]>, size=430, nrcpt=1 (queue active)
Jan 22 14:33:15 server postfix/smtp[5276]: connect to gmail-smtp-in.l.google.com[2a00:1450:400c:c05::1b]:25: Network is unreachable
Jan 22 14:33:15 server postfix/smtp[5276]: connect to gmail-smtp-in.l.google.com[173.194.66.26]:25: Connection refused
Jan 22 14:33:15 server postfix/smtp[5276]: connect to alt1.gmail-smtp-in.l.google.com[2a00:1450:400c:c05::1a]:25: Network is unreachable
Jan 22 14:33:15 server postfix/smtp[5276]: connect to alt1.gmail-smtp-in.l.google.com[173.194.70.26]:25: Connection refused
Jan 22 14:33:15 server postfix/smtp[5276]: connect to alt2.gmail-smtp-in.l.google.com[2a00:1450:400c:c05::1b]:25: Network is unreachable
Jan 22 14:33:15 server postfix/smtp[5276]: 316FEBF65E: to=<[email protected]>, relay=none, delay=2662, delays=2661/0.04/0.08/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[2a00:1450:400c:c05::1b]:25: Network is unreachable)
但我可以对主机进行ping通:
ping gmail-smtp-in.l.google.com
PING gmail-smtp-in.l.google.com (173.194.66.26) 56(84) bytes of data.
64 bytes from we-in-f26.1e100.net (173.194.66.26): icmp_seq=1 ttl=128 time=29.2 ms
64 bytes from we-in-f26.1e100.net (173.194.66.26): icmp_seq=2 ttl=128 time=29.6 ms
64 bytes from we-in-f26.1e100.net (173.194.66.26): icmp_seq=3 ttl=128 time=31.0 ms
如果SMTP问题似乎可以进行配置,那么要做的第一件事是实际上可以访问SMTP服务器。
使用:
telnet gmail-smtp-in.l.google.com 25
您应该看到:
Trying 173.194.69.27...
Connected to gmail-smtp-in.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP lv5si9142984bkb.114 - gsmtp
(在那之后键入QUITEnter退出)。如果那没有显示出来,则您的防火墙(或更可能是您的提供商之一)可能阻止了您。如果可能,请从另一个位置尝试此操作,以再次检查机器是否正在响应(在您的情况下gmail-smtp-in.l.google.com
正在响应)。
如果是提供商的原因,则您可能需要使用其STMP服务器(他们试图以这种方式防止垃圾邮件从您的系统中消失)。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句