为什么Postfix在本地发送邮件而不是将它们转发到Google Apps?

尝试从我的Postfix服务器发送电子邮件到[email protected] Google Apps电子邮件时[email protected]以下错误。

to =,relay = local,delay = 0.09,delay = 0.07 / 0/0 / 0.02,dsn = 5.1.1,status = bounced(未知用户:“admin”)

有没有一种方法,我可以强制它不使用本地中继和对待作为外部电子邮件的[email protected] ,并不寻找在当前的后缀configuration用户。

我正试图通过电子邮件发送完整的电子邮件地址“[email protected]”而不是“pipe理员”。

我在mydomain.com + SPFlogging上有Google Apps MXlogging,以前是:

v = spf1包括:_spf.google.com〜全部 (通过电子邮件发送给[email protected]用于处理该logging)

但是我不得不把它改成v = spf1 a mx ip4:MY.IP.HERE包括:_spf.google.com〜all

是的你可以。 不要使用admin作为收件人。 使用类似于[email protected] “外部” [email protected]

这只适用于mydomain.com不是在Postfix中configuration的域。 因为Postfix认为一切都是本地的,当你把它configuration成本地的时候。

你应该提供更多的信息,而不是“它不工作”。 什么是您configuration的域名,中继主机,交通地图,MXlogging等?

设置fallback_transportvariables来传递,这样它会将它发送给Google或任何它应该的服务器,如果没有在本地find用户。

如果你永远不想把邮件发送给本地用户,那么把mydestinationvariables改为localhost,这样它只能转发本地邮件地址,以.localhost结尾

它看起来像你的main.cf文件中:

 mydestination = localhost.localdomain, localhost fallback_transport = relay 

简单的说,在postfixmain.cf文件中你可以列出目标电子邮件域。 在这个例子中,我们将假设如下:

  1. 在这台服务器上,您将托pipeexample.com LAMP / LEMP网站。
  2. 你有一个在线联系表格(例如php)发送邮件到[email protected](从[email protected][email protected]
  3. 您的example.com电子邮件实际上是GSuite或其他服务。 不在这个服务器上。

症状:如果您更改在线表单发送电子邮件到您的个人电子邮件[email protected]它工作正常。 但没有任何信息到达您的[email protected]收件箱。

补救措施:检查您的电子邮件域是否列在postfixconfiguration中的“mydestination”下

 grep mydestination /etc/postfix/main.cf mydestination = $myhostname, example.com, my.actual.hostname, localhost -----------------------------^^^^^^^^^^^-------------------------------- vi /etc/postfix/main.cf # removed example.com mydestination = $myhostname, my.actual.hostname, localhost service postfix reload 

为我修好了! 希望它可以帮助你。