Postfixの設定 - サブドメインとドメインに異なるサーバー

Postfixの設定 - サブドメインとドメインに異なるサーバー

次のような設定をしています: 1 台の postfix サーバー: a.example.comexample.com ( ) のすべてのサブドメインのメールをすべて受け入れ*@*.example.com、mailman アカウントに配信し、 を含むすべてのメール アカウント (gmail、yahoo など) にメールを送信する必要があります*@example.com。 1 台のホストされた exchange: exch11.hosted.comexample.com のメール用 ( *@example.com)。

この設定では、a.example.com から*@example.com( ) にメールを送信する以外はすべて機能します。mydomains.dbファイルにexch11.hosted.comがある場合、 はメールを送信せず、ローカルに配信します。 に変更すると、にメールが送信されますが、メールは受信されず、リレーが許可されていないというエラーが表示されます (ローカルの maildir アカウントにリレーして配信してはいけません)。example.coma.example.com*@example.com*.example.com*@example.comexch11.hosted.com*@subdomain.example.com

主な要件は、a.example.com が任意のサブドメインのメールを受け入れ、メイン ドメインのメールを exch11.hosted.com に配信することです。どなたか私を助けていただくか、正しい方向を示していただけますか?

どのような助けでも歓迎します。

ありがとう。

メイン.cf:

command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mydestination = hash:/etc/postfix/mydomains
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
home_mailbox = Maildir/
smtpd_banner = mail.example.com

debug_peer_level = 2
debugger_command =
     PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
     xxgdb $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.3.3/samples
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
virtual_alias_maps = hash:/etc/postfix/virtual, pcre:/etc/postfix/virtual.pcre
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtp_sasl_security_options = noplaintext
#smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/sender-access
smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/inbound-access,permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
mailbox_size_limit = 25600000
transport_maps = hash:/etc/postfix/transport
message_size_limit = 20240000

virtual.pcre および virtual:

/(.*)@[^.]*\.example\.com$/ mailman

輸送:

# demo
.demo.example.com   smtp:192.168.100.161:25
# demo mail
demo.example.com    smtp:192.168.100.161
# Demo2
.demo2.example.com  smtp:192.168.100.221:25
# demo2 domain
demo2.example.com   smtp:192.168.100.221

私のドメイン:

localhost       OK
mail.local  OK
example.com     OK

答え1

まず、これがうまくいくかどうかはわかりませんが、始めるのに役立つことを願っています。

  1. この postfix インスタンスは example.com 宛のメールを直接処理しないため、mydomains から example.com を削除します。
  2. これを追加するとvirtual_alias_domains = .example.comサブドメインの問題が解決するはずです
  3. relay_domains = example.comexample.com の明示的なトランスポートを追加して指定します。例:example.com :[exch11.hosted.com]

関連情報