自分のドメインを指すときにMxがIPとして解決されない

自分のドメインを指すときにMxがIPとして解決されない

私はpostfixを実行しており、以前はドメイン(mail.firstdomain.comなど)にメールサーバーを設定しました。最近、mail.seconddomain.comなどの他のドメインを追加しました。

2番目のドメインのMXレコードでは、最初のドメインと同じ設定をコピーし、関連部分のみを変更しました。ただし、サーバー外では電子メールを受信できません。内部でのみ電子メールを受信できます。その後、seconddomain.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]
...

おすすめ記事