我已经在我的debian wheezy服务器上设置了一个Exim4服务器。 该邮件服务器只发送来自本地主机的邮件。 目的是为我的网站发送邮件。
我有cron任务和其他服务为root用户生成邮件。 这些/var/mail不像以前一样存储在/var/mail中,而是通过exim发送到[email protected] 。
我试图让exim发送邮件到root用户[email protected]而不是[email protected] 。
我尝试在/root用[email protected]添加一个.forward作为内容。 我也试着用root: [email protected]改变/etc/aliases root: [email protected] 。 事实上,路由适用于root@localhost但不适用于以[email protected]parsing的[email protected]
我testing了如何使用exim -bt解决路由问题:
root@srv02:~# exim -bt root@localhost R: system_aliases for root@localhost R: dnslookup for [email protected] [email protected] <-- root@localhost router = dnslookup, transport = remote_smtp host gmail-smtp-in.l.google.com [173.194.67.27] MX=5 host alt1.gmail-smtp-in.l.google.com [74.125.143.27] MX=10 host alt2.gmail-smtp-in.l.google.com [74.125.25.27] MX=20 host alt3.gmail-smtp-in.l.google.com [173.194.64.27] MX=30 host alt4.gmail-smtp-in.l.google.com [74.125.142.27] MX=40 root@srv02:~# exim -bt root R: dnslookup for [email protected] [email protected] router = dnslookup, transport = remote_smtp host aspmx.l.google.com [173.194.78.27] MX=1 host alt1.aspmx.l.google.com [74.125.143.27] MX=5 host alt2.aspmx.l.google.com [74.125.25.27] MX=5 host alt4.aspmx.l.google.com [74.125.142.27] MX=10 host alt3.aspmx.l.google.com [173.194.64.27] MX=10
我敢打赌,这是一个如何configuration我的服务器(而不是如何configurationexim)的问题。 但为了理解,我想为这两个解决scheme:
rootparsing为root@localhost ? [email protected]路由到[email protected] ? 您正在使用的debugging输出表明您正在使用Debian风格的configuration系统。 我将其称为exim4 ,以便清楚地说明,除了源代码中默认的eximconfiguration外,还有一些额外的configuration魔法。 任何人以后阅读这个需要清楚地理解,这个build议的一些不适用,除非他们正在运行Debian风格的eximconfiguration。
-bt输出的差异给出了一个线索:
root@srv02:~# exim -bt root@localhost R: system_aliases for root@localhost R: dnslookup for [email protected] [email protected] root@srv02:~# exim -bt root R: dnslookup for [email protected] [email protected]
在第一个,它知道要查看system_aliases路由器,因为“localhost”被configuration为允许查看别名文件的域之一。 但在第二个,它跳过了别名文件,因为“mydomain.com”不在该列表中。 在exim4中,该列表是MAIN_LOCAL_DOMAINSmacros。
据我估计,这些事情之一可能会解决你的问题。 第2项及以后的项目可能会对您的exim.conf进行调整。 由于运行了exim.4,所以需要在/ etc / exim /中调整Debian邮件configuration文件,然后运行exim4-conf.conf或类似的东西来读取这些更改并生成新的configuration文件(/ var / lib / exim4 / config.autogenerated *)exim4实际使用: