配置 Postfix 以便为域外部路由邮件

配置 Postfix 以便为域外部路由邮件

我有一个在 amazon EC2 ubuntu 实例中运行的网站。我的网络服务器是 apache。我正在使用 php 邮件功能从联系人表单发送邮件。我已经安装了 postfix 并使用了默认配置。我们域的电子邮件由 rackspace 托管。当联系人表单尝试向我们域中的电子邮件 ID 发送邮件时([电子邮件保护]) 是有效的 ID,mail.log 显示 postfix 正在尝试在本地发送。但是对于 gmail ID,它工作正常。以下是来自服务器的 mail.log:

Sep 17 07:48:15 ip-10-134-177-117 postfix/pickup[2189]: EC11D68106: uid=0 from=<root>
Sep 17 07:48:15 ip-10-134-177-117 postfix/cleanup[11700]: EC11D68106: message-id=<20110917074815.EC11D68106@ip-10-134-177-117.ap-southeast-1.compute.internal>
Sep 17 07:48:15 ip-10-134-177-117 postfix/qmgr[17377]: EC11D68106: from=<[email protected]>, size=650, nrcpt=1 (queue active)
Sep 17 07:48:15 ip-10-134-177-117 postfix/local[11702]: EC11D68106: to=<[email protected]>, orig_to=<root>, relay=local, delay=0.05, delays=0.03/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to mailbox)
Sep 17 07:48:15 ip-10-134-177-117 postfix/qmgr[17377]: EC11D68106: removed
Sep 17 08:01:53 ip-10-134-177-117 postfix/pickup[13498]: AC5EA68106: uid=33 from=<www-data>
Sep 17 08:01:53 ip-10-134-177-117 postfix/cleanup[13628]: AC5EA68106: message-id=<20110917080153.AC5EA68106@ip-10-134-177-117.ap-southeast-1.compute.internal>
Sep 17 08:01:53 ip-10-134-177-117 postfix/qmgr[17377]: AC5EA68106: from=<[email protected]>, size=604, nrcpt=4 (queue active)
Sep 17 08:01:53 ip-10-134-177-117 postfix/local[13631]: AC5EA68106: to=<[email protected]>, relay=local, delay=0.28, delays=0.04/0.23/0/0.02, dsn=5.1.1, status=bounced (unknown user: "info")
Sep 17 08:01:55 ip-10-134-177-117 postfix/local[13632]: AC5EA68106: to=<[email protected]>, relay=local, delay=1.5, delays=0.04/0.23/0/1.2, dsn=5.1.1, status=bounced (unknown user: "nithin.kv")
Sep 17 08:01:58 ip-10-134-177-117 postfix/smtp[13630]: AC5EA68106: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[74.125.45.27]:25, delay=5.2, delays=0.04/0.08/0.94/4.2, dsn=2.0.0, status=sent (250 2.0.0 OK 1316246518 m10si2182807yhk.92)
Sep 17 08:01:58 ip-10-134-177-117 postfix/smtp[13630]: AC5EA68106: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[74.125.45.27]:25, delay=5.2, delays=0.04/0.08/0.94/4.2, dsn=2.0.0, status=sent (250 2.0.0 OK 1316246518 m10si2182807yhk.92)
Sep 17 08:01:58 ip-10-134-177-117 postfix/cleanup[13628]: DB42468107: message-id=<20110917080158.DB42468107@ip-10-134-177-117.ap-southeast-1.compute.internal>
Sep 17 08:01:58 ip-10-134-177-117 postfix/qmgr[17377]: DB42468107: from=<>, size=2795, nrcpt=1 (queue active)
Sep 17 08:01:58 ip-10-134-177-117 postfix/bounce[13633]: AC5EA68106: sender non-delivery notification: DB42468107
Sep 17 08:01:58 ip-10-134-177-117 postfix/qmgr[17377]: AC5EA68106: removed
Sep 17 08:01:58 ip-10-134-177-117 postfix/local[13631]: DB42468107: to=<[email protected]>, relay=local, delay=0.09, delays=0.01/0/0/0.07, dsn=2.0.0, status=sent (delivered to mailbox)
Sep 17 08:01:58 ip-10-134-177-117 postfix/qmgr[17377]: DB42468107: removed
Sep 17 08:27:43 ip-10-134-177-117 postfix/pickup[13498]: 22FC468106: uid=33 from=<www-data>
Sep 17 08:27:43 ip-10-134-177-117 postfix/cleanup[15563]: 22FC468106: message-id=<20110917082743.22FC468106@ip-10-134-177-117.ap-southeast-1.compute.internal>
Sep 17 08:27:43 ip-10-134-177-117 postfix/qmgr[17377]: 22FC468106: from=<[email protected]>, size=624, nrcpt=5 (queue active)
Sep 17 08:27:43 ip-10-134-177-117 postfix/local[15566]: 22FC468106: to=<[email protected]>, relay=local, delay=0.06, delays=0.03/0.02/0/0.02, dsn=5.1.1, status=bounced (unknown user: "info")
Sep 17 08:27:44 ip-10-134-177-117 postfix/local[15567]: 22FC468106: to=<[email protected]>, relay=local, delay=0.98, delays=0.03/0.02/0/0.93, dsn=5.1.1, status=bounced (unknown user: "nithin.kv")
Sep 17 08:27:45 ip-10-134-177-117 postfix/smtp[15565]: 22FC468106: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[74.125.45.26]:25, delay=2.9, delays=0.03/0.02/0.93/1.9, dsn=2.0.0, status=sent (250 2.0.0 OK 1316248065 g47si9242631yhn.13)
Sep 17 08:27:45 ip-10-134-177-117 postfix/smtp[15565]: 22FC468106: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[74.125.45.26]:25, delay=2.9, delays=0.03/0.02/0.93/1.9, dsn=2.0.0, status=sent (250 2.0.0 OK 1316248065 g47si9242631yhn.13)
Sep 17 08:27:45 ip-10-134-177-117 postfix/smtp[15565]: 22FC468106: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[74.125.45.26]:25, delay=2.9, delays=0.03/0.02/0.93/1.9, dsn=2.0.0, status=sent (250 2.0.0 OK 1316248065 g47si9242631yhn.13)
Sep 17 08:27:45 ip-10-134-177-117 postfix/cleanup[15563]: F3DBA68107: message-id=<20110917082745.F3DBA68107@ip-10-134-177-117.ap-southeast-1.compute.internal>
Sep 17 08:27:46 ip-10-134-177-117 postfix/qmgr[17377]: F3DBA68107: from=<>, size=2815, nrcpt=1 (queue active)
Sep 17 08:27:46 ip-10-134-177-117 postfix/bounce[15568]: 22FC468106: sender non-delivery notification: F3DBA68107
Sep 17 08:27:46 ip-10-134-177-117 postfix/qmgr[17377]: 22FC468106: removed
Sep 17 08:27:46 ip-10-134-177-117 postfix/local[15566]: F3DBA68107: to=<[email protected]>, relay=local, delay=0.02, delays=0.01/0/0/0.01, dsn=2.0.0, status=sent (delivered to mailbox)
Sep 17 08:27:46 ip-10-134-177-117 postfix/qmgr[17377]: F3DBA68107: removed

如何告诉 postfix 将我发送到 jivity.com 的邮件路由到外部,而不是将其视为本地域?谢谢。

答案1

该域名很可能已在 Postfix 中列出'我的目的地指令。解决方案是编辑您的/etc/postfix/main.cf并改变我的主机名我的目的地指令:

myhostname = hostname.jivity.com
mydestination = $myhostname

这样您的邮件服务器将只考虑主机名.jivity.com作为本地主机名,其他所有内容都将被正确路由。

答案2

您的机器最终目的地您需要调整$mydestination这样这些邮箱就不再本地域类并且不会得到传递给当地交通

相关内容