Mx 在指向自己的域时未解析为 IP

Mx 在指向自己的域时未解析为 IP

我正在运行 postfix,并且之前已经在域(例如 mail.firstdomain.com)上设置了邮件服务器。最近我添加了另一个域,例如mail.seconddomain.com。

在第二个域的 MX 记录中,我复制了与第一个域相同的设置,只是更改了相关部分。但是,我无法从服务器外部接收电子邮件 - 只能在内部接收。然后,我将 secondarydomain.com 的 mx 记录更改为主 myhostname:mail.firstdomain.com,现在它可以正常工作了。

我的配置中遗漏了什么,导致我无法使用 mail.seconddomain.com?

这是 postconf -n 的输出:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debug_peer_list = 127.0.0.1
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_owner = postfix
mailbox_size_limit = 0
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 40960000
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain
mydomain = firstdomain.com
myhostname = mail.firstdomain.com
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
relay_domains = $mydestination, firstdomain.com, seconddomain.com
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_client_restrictions = permit_sasl_authenticated
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_helo_required = yes
smtpd_helo_restrictions = reject_non_fqdn_hostname
smtpd_recipient_restrictions = permit_sasl_authenticated,   permit_mynetworks,        reject_invalid_hostname,        reject_unauth_pipelining, reject_unauth_destination,  reject_rbl_client sbl-xbl.spamhaus.org,             permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = no
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = reject_unknown_sender_domain
soft_bounce = no
unknown_local_recipient_reject_code = 550
virtual_alias_domains = mail.seconddomain.com
virtual_alias_maps = hash:/etc/postfix/virtual

答案1

此方法可能不适合您的用例,尽管我通常将其他域放入virtual(5)

# postconf relay_domains virtual_alias_maps
relay_domains = $mydestination
virtual_alias_maps = hash:/etc/postfix/virtual

其中$mydestination包含相当于您的第一个域的域名和主机名。虚拟地图包含:

otherdomain.edu   anything
[email protected]    [email protected]
...

相关内容