我刚刚安装了exim4
,我的/etc/hosts
文件如下所示:
127.0.0.1 localhost
127.0.1.1 mycomputer
192.168.100.5 rpi.mydomain.com
然而,当我运行测试可传递性时,它显示:exim -bt [email protected]
R: dnslookup for [email protected]
[email protected] is undeliverable
看来 Exim 没有使用 中的条目/etc/hosts
来解析域名。为了解决这个问题,我在/etc/exim4/conf.d/router/200_exim4-config_primary
所有其他路由器条目之前添加了这个:
mycustomlookup:
debug_print = "R: mycustomlookup for $local_part@$domain"
driver = manualroute
transport = remote_smtp
route_list=rpi.mydomain.com 192.168.100.5
问题解决了。:exim -bt [email protected]
R: mycustomlookup for [email protected]
[email protected]
router = mycustomlookup, transport = remote_smtp
host 192.168.100.5 [192.168.100.5]
现在的问题是我不想每次更改条目时都必须手动编辑 Exim 配置/etc/hosts
。有没有办法让 Exim 用来/etc/hosts
解析域名?