我使用提供商邮件托管来发送电子邮件。在我的 Web 服务器上,我还运行并配置了 Postfix。这是我的主配置文件
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = yes
readme_directory = no
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
myhostname = 2-5-8.bih.net.ba
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = bhcom.info, 2-5-8.bih.net.ba, localhost.bih.net.ba, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command =
mailbox_size_limit = 10485760
recipient_delimiter = +
inet_interfaces = 80.65.85.114
当我尝试向托管域名发送电子邮件时,每封邮件都会因此错误而被退回:
Nov 4 20:38:34 2-5-8 postfix/pickup[802]: 1492A3E0C6C: uid=0 from=<[email protected]>
Nov 4 20:38:34 2-5-8 postfix/cleanup[988]: 1492A3E0C6C: message-id=<[email protected]>
Nov 4 20:38:34 2-5-8 postfix/qmgr[803]: 1492A3E0C6C: from=<[email protected]>, size=348, nrcpt=1 (queue active)
Nov 4 20:38:34 2-5-8 postfix/local[990]: 1492A3E0C6C: to=<[email protected]>, relay=local, delay=0.12, delays=0.08/0.01/0/0.04, dsn=5.1.1, status=bounced (unknown user: "info")
Nov 4 20:38:34 2-5-8 postfix/cleanup[988]: 28ED53E0C6D: message-id=<[email protected]>
Nov 4 20:38:34 2-5-8 postfix/qmgr[803]: 28ED53E0C6D: from=<>, size=2056, nrcpt=1 (queue active)
Nov 4 20:38:34 2-5-8 postfix/bounce[991]: 1492A3E0C6C: sender non-delivery notification: 28ED53E0C6D
Nov 4 20:38:34 2-5-8 postfix/qmgr[803]: 1492A3E0C6C: removed
Nov 4 20:38:34 2-5-8 postfix/local[990]: 28ED53E0C6D: to=<[email protected]>, relay=local, delay=0.06, delays=0.03/0/0/0.02, dsn=5.1.1, status=bounced (unknown user: "razvoj")
Nov 4 20:38:34 2-5-8 postfix/qmgr[803]: 28ED53E0C6D: removed
但是,当我尝试访问 @gmail.com 时,它发送消息没有问题,以下是日志。可能是什么问题?
Nov 4 20:41:23 2-5-8 postfix/pickup[802]: B2EC63E0C6C: uid=0 from=<[email protected]>
Nov 4 20:41:23 2-5-8 postfix/cleanup[1022]: B2EC63E0C6C: message-id=<[email protected]>
Nov 4 20:41:23 2-5-8 postfix/qmgr[803]: B2EC63E0C6C: from=<[email protected]>, size=350, nrcpt=1 (queue active)
Nov 4 20:41:23 2-5-8 postfix/smtp[1024]: connect to gmail-smtp-in.l.google.com[2a00:1450:4001:c02::1a]:25: Network is unreachable
Nov 4 20:41:24 2-5-8 postfix/smtp[1024]: B2EC63E0C6C: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[173.194.70.26]:25, delay=0.97, delays=0.08/0.01/0.27/0.62, dsn=2.0.0, status=sent (250 2.0.0 OK 1352058066 f7si2180442eeo.46)
Nov 4 20:41:24 2-5-8 postfix/qmgr[803]: B2EC63E0C6C: removed
答案1
嗯,日志是这么说的:
Nov 4 20:38:34 2-5-8 postfix/local[990]: 1492A3E0C6C: to=<[email protected]>, relay=local, delay=0.12, delays=0.08/0.01/0/0.04, dsn=5.1.1, status=bounced (unknown user: "info")
Nov 4 20:38:34 2-5-8 postfix/local[990]: 28ED53E0C6D: to=<[email protected]>, relay=local, delay=0.06, delays=0.03/0/0/0.02, dsn=5.1.1, status=bounced (unknown user: "razvoj")
您没有本地用户info
,也没有razvoj
本地投递可以投递邮件。如果我理解您的帖子没有错的话,您确实想从那台机器发送邮件,但这不是您想要接收和阅读邮件的邮件服务器,对吗?
如果正确的话,只需删除bhcom.info
它mydestination
,一切都会好起来。
一些背景知识:mydestination
Postfix 认为列出的每个主机名都是本地的,然后 itr 会尝试将邮件发送给该本地用户,但在您的情况下,该本地用户并不存在。
答案2
还要确保您拥有所需的所有软件包。我在 main.cf 中正确设置了中继主机,但直到我执行此操作(在 Ubuntu 14.04 上)时,中继才显示为无:
apt-get install mailutils libsasl2-2 ca-certificates libsasl2-modules
不确定为什么这样可以修复它。以上内容来自 postfix 转发的 HOWTO,网址为easyengine.io。