我pipe理一堆开发和暂存debian(v.6-8)服务器。 目前的exim4设置如下所示:
由于舞台和开发者服务器的电子邮件function将通过networking应用程序进行testing,并且在我们的Web应用程序中设置了真实世界的场景电子邮件地址。我想要的设置是:
本教程最接近我的目标,即使它使用相反的策略:允许所有发件人并拒绝一个发件人。
https://serverfault.com/a/577007/322673
任何帮助真的很感激,因为我将是疯狂的eximconfiguration语法。
现在我已经经历了很多configuration样本,但是没有一个与我的用例相匹配。
由于Exim按路由器部分指定的顺序处理邮件,我想可以通过以下规则来实现。 一定要先把规则放在特殊的领域,然后抓住所有的规则。
# sender domain based routing router_for_special_domain_sender: driver = dnslookup senders = *@example.com transport = remote_smtp no_more # reciepients domain based routing router_for_special_domain_reciepints: driver = dnslookup domains = example.com transport = remote_smtp no_more catch_all_outgoing: driver = redirect data = [email protected]
根据Exim 文件 :
域
如果设置了域选项,则地址的域必须位于其定义的域集中。
发件人
如果设置了该选项,则路由器将被跳过,除非该消息的发件人地址与列表中的内容匹配。 请参阅第3.12节,了解先决条件的评估顺序。
上面的第一个规则告诉exim发送所有发件人域名为example.com的电子邮件,而不需要做任何特别的事情。 第二条规则是抓住所有的电子邮件。 你可以试试看。
这里是相关的讨论: http : //www.gossamer-threads.com/lists/exim/users/97056
begin routers
router_for_special_domain_reciepint: driver = manualroute domains = example.com transport = remote_smtp route_list = "* internalsmarthost.example.com " no_more
catch_all_outgoing:driver = redirect data = [email protected]
由于我使用smarthost两个,在router_for_special_domain_recipient路由器和catch_all_outgoing路由器的例外,我不得不添加route_list选项。 使用dnslookup驱动程序可以将邮件直接发送到目标而不使用智能主机。