postfix 无法发送电子邮件

postfix 无法发送电子邮件

我最近将一些网站从旧服务器迁移到了 DigitalOcean 上具有相同配置的新服务器。

除了 php mail() 函数不能发送电子邮件以外,网站运行良好。

php 配置与旧服务器相同,我看不出问题出在哪里。

后缀配置是:

$ postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = localhost
inet_protocols = ipv4
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = MY_DOMAIN
myhostname = MY_DOMAIN
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550

进行测试时,邮件日志输出如下:

Jun  3 16:43:18 tori postfix/pickup[3648]: 7F6D8480E73: uid=500 from=<[email protected]>
Jun  3 16:43:18 tori postfix/cleanup[4033]: 7F6D8480E73: message-id=<20150603204318.7F6D8480E73@MY_DOMAIN>
Jun  3 16:43:18 tori postfix/qmgr[3649]: 7F6D8480E73: from=<[email protected]>, size=360, nrcpt=1 (queue active)
Jun  3 16:43:18 tori postfix/error[3992]: 7F6D8480E73: to=<[email protected]>, relay=none, delay=0.06, delays=0.05/0/0/0.01, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to aspmx5.googlemail.com[74.125.205.27]:25: Connection timed out)

你能帮助我吗?

谢谢。

答案1

与我的服务器提供商(DigitalOcean)交谈后,我发现他们阻止了从我的服务器发出的电子邮件。

问题已经解决了。

谢谢。

相关内容