我们有一个不寻常的邮件设置 – 前面的Google Apps / Gmail,Exim在我们的networking服务器上运行。 将Google Apps中不存在的任何帐户的邮件转发给Exim。 这两个使用相同的域。
问题是,从Exim帐户(或我们的PHP应用程序)发送的所有邮件只能在本地交付,而不是通过Gmail发送。
为了更好地说明,请看这个高质量的图表:
[Google Apps] (Tom, Dick, Harry) | v [Exim] (Jane, Mary, Sue)
发送给Jane的邮件被Google转发给Exim。 发送给Tom的邮件仅由Google提供。 这是工作的一部分 – 问题是, 简不能给汤姆发邮件,因为就Exim而言,它运行整个演出。
我正在阅读关于在Exim中设置SmartHost的内容,但这需要进行身份validation – 而且严格来说,Exim中的帐户与应用程序中的帐户不匹配。
我怎样才能configurationExim通过外部路由提供本地邮件?
根据您在问题的注释中提到的答案( configuration服务器以将不可路由的电子邮件发送到另一个电子邮件服务器 ),我重写了逻辑部分以使用整个电子邮件地址,而不仅仅是本地部分。 以下似乎在我的testing工作。
1)将example.com放入你的+ local_domains。
2)添加他推荐的路由器。 (在这个接受+ local_domains和拥有有效的本地邮箱的用户之后,应该有另一个路由器):
not_local: driver = manualroute domains = +local_domains transport = remote_smtp condition = ${lookup{$local_part@$domain}lsearch{/etc/exim/forward_to_google}} # Use whatever MX is correct for your domain below route_list = +local_domains s7a1.psmtp.com
3)创build/etc/exim/forward_to_google并放入:
[email protected]: yes # Not required if this is a local account, but # shows how flexible this approach can be [email protected]: no
4)你可以用exim的-bt地址testing选项来testing(我的configuration没有为有效的本地用户设置第二个路由器,但是你的第一个用户应该显示本地交付):
$ exim -bt [email protected] [email protected] is undeliverable: Unrouteable address $ exim -bt [email protected] [email protected] router = not_local, transport = remote_smtp host s7a1.psmtp.com [64.18.6.10]