使用 exim 从 vm1 向 vm2 发送电子邮件时无法路由地址

使用 exim 从 vm1 向 vm2 发送电子邮件时无法路由地址

我正在尝试从虚拟机 1 向虚拟机 2 发送电子邮件,但出现了错误Unroutable address,具体来说dnslookup_relay_to_domains router declined for user@lab1

查看 exim 文档我发现了这一点This option specifies a text message that is used when an address cannot be routed because Exim has run out of routers. The default message is “Unrouteable address”,但我仍然不明白如何解决这个问题。

虚拟机 1 的主机名是lab1,IP 地址是10.0.2.5

虚拟机 2 的主机名是lab2,IP 地址是10.0.2.6

以下是 update-exim4.cong.conf 中的设置:

dc_eximconfig_configtype='internet'
dc_other_hostnames='lab2; localhost'
dc_local_interfaces='127.0.0.1'
dc_readhost=''
dc_relay_domains='lab1'
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost=''
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname='false'
dc_mailname_in_oh='true'
dc_localdelivery='maildir_home'

模拟exim -bhc发送电子邮件到 10.0.2.5 我得到:

>>> routing user@lab1
>>> expansion of "${if exists{/etc/exim4/hubbed_hosts}{partial-lsearch;/etc/exim4/hubbed_hosts}fail}" forced failure: assume not in this list
>>> lab1 in "! +local_domains : +relay_to_domains"? yes (matched "+relay_to_domains" - cached)
>>> R: dnslookup_relay_to_domains for user@lab1
>>> calling dnslookup_relay_to_domains router
>>> dnslookup_relay_to_domains router declined for user@lab1
>>> "more" is false: skipping remaining routers
>>> no more routers
>>> ----------- end verify ------------
>>> require: condition test failed in ACL "acl_check_rcpt"
>>> end of ACL "acl_check_rcpt": not OK
550 Unrouteable address
LOG: H=(mail) [10.0.2.6] F=<user@lab2> rejected RCPT user@lab1: Unrouteable address

答案1

我尝试了很多方法,但配置有点混乱。最后我终于解决了这个问题,并使用了“由智能主机发送的邮件”的配置。我对配置进行了以下更改:

dc_eximconfig_configtype='internet'变成dc_eximconfig_configtype='smarthost'

dc_relay_domains='lab1'变成dc_relay_domains=''

dc_smarthost=''变成dc_smarthost='lab1'

相关内容