Email-Server

從 vm1 到 vm2 發送帶有 exim 的電子郵件時無法路由的地址

  • January 26, 2019

我正在嘗試從虛擬機 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

我一直在嘗試很多事情,但配置有點混亂。最後整理了一下,使用了“smarthost發送的郵件”的配置。我對配置做了以下更改:

dc_eximconfig_configtype='internet'變成dc_eximconfig_configtype='smarthost'

dc_relay_domains='lab1'變成dc_relay_domains=''

dc_smarthost=''變成dc_smarthost='lab1'

引用自:https://serverfault.com/questions/950908