質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

Postfix

Postfixは、電子メールサーバソフトウェアで、 メールを配送するシステムMTAの一種です。

Q&A

解決済

1回答

6030閲覧

バーチャルドメインでのmailman設定

leo

総合スコア11

CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

Postfix

Postfixは、電子メールサーバソフトウェアで、 メールを配送するシステムMTAの一種です。

0グッド

0クリップ

投稿2018/06/27 08:50

前提・実現したいこと

centos7+postfix+dovecot+mysql+postfixadmin+SSL環境にmailmanを導入を希望です。
postfixはすべてバーチャルドメインにて設定(mysql)し、自ドメインは使用しない設定にしてます。
サイトをいくつか見ながら、設定しましたが、mailmanとうまく紐づいてないようで、配送に失敗しています。
そもそもの設定ができてない部分が多分にあるため、動作できてないのでしょうが、確認ポイント等ございましたら、ご教授いただけますと幸いです。
また、提示している情報が不足しているものがございましたら、ご指摘いただけますでしょうか。

発生している問題・エラーメッセージ

Jun 27 17:02:41 www postfix/qmgr[5571]: 93128161C76: from=<postmaster@example.com>, size=2534, nrcpt=1 (queue active) Jun 27 17:02:42 www postfix/smtpd[5755]: disconnect from xxx-xxx-xxx-xxx.cidr.provider.ne.jp[xxx.xxx.xxx.xxx] Jun 27 17:02:42 www postfix/smtp[5763]: 93128161C76: to=<testml01@www.localdomain>, orig_to=<testml01@list.example.com>, relay=none, delay=0.42, delays=0.4/0.01/0.01/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=www.localdomain type=A: Host not found) Jun 27 17:02:42 www postfix/cleanup[5762]: 12288161C8A: message-id=<20180627080242.12288161C8A@www.localdomain> Jun 27 17:02:42 www postfix/bounce[5764]: 93128161C76: sender non-delivery notification: 12288161C8A Jun 27 17:02:42 www postfix/qmgr[5571]: 12288161C8A: from=<>, size=5422, nrcpt=1 (queue active) Jun 27 17:02:42 www postfix/qmgr[5571]: 93128161C76: removed

該当のソースコード

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 debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 home_mailbox = Maildir/ html_directory = no inet_interfaces = all inet_protocols = ipv4 local_transport = virtual mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man message_size_limit = 10485760 milter_default_action = accept mydestination = newaliases_path = /usr/bin/newaliases.postfix non_smtpd_milters = $smtpd_milters owner_request_special = no queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES recipient_delimiter = + relay_domains = $mydestination sample_directory = /usr/share/doc/postfix-2.10.1/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtp_tls_CAfile = /etc/letsencrypt/live/example.com/chain.pem smtp_tls_loglevel = 1 smtp_tls_security_level = may smtpd_banner = $myhostname ESMTP unknown smtpd_milters = inet:localhost:8891 smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination smtpd_sasl_auth_enable = yes smtpd_sasl_authenticated_header = yes smtpd_sasl_local_domain = $myhostname smtpd_sasl_path = private/auth smtpd_sasl_security_options = noanonymous smtpd_sasl_type = dovecot smtpd_tls_cert_file = /etc/letsencrypt/live/example.com/fullchain.pem smtpd_tls_key_file = /etc/letsencrypt/live/example.com/privkey.pem smtpd_tls_loglevel = 1 smtpd_tls_security_level = may smtpd_tls_session_cache_database = btree:/var/lib/postfix/smtpd_scache transport_maps = hash:/etc/postfix/transport unknown_local_recipient_reject_code = 550 virtual_alias_domains = $virtual_alias_maps virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf,hash:/etc/mailman/virtual-mailman, regexp:/etc/postfix/virtual virtual_gid_maps = static:10000 virtual_mailbox_base = /home/vmail virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf virtual_mailbox_limit = 0 virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf virtual_mailbox_limit_override = yes virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please try again later. virtual_minimum_uid = 10000 virtual_overquota_bounce = yes virtual_transport = virtual virtual_uid_maps = static:10000

mm_cfg.py

POSTFIX_VIRTUAL_DOMAIN = ['list.example.com'] POSTFIX_STYLE_VIRTUAL_DOMAINS = ['list.example.com'] add_virtualhost('list.example.com','list.example.com') MTA = 'Postfix' DEFAULT_SERVER_LANGUAGE = 'ja' DEFAULT_LIST_ADVERTISED = No OWNERS_CAN_DELETE_THEIR_OWN_LISTS = Yes DEFAULT_SUBJECT_PREFIX = "[%(real_name)s:%%d] " DEFAULT_REPLY_GOES_TO_LIST = 1 DEFAULT_MSG_FOOTER = "" DEFAULT_GENERIC_NONMEMBER_ACTION = 1

/etc/postfix/transport

testml01@list.example.com local

補足情報(FW/ツールのバージョンなど)

CentOS Linux release 7.5.1804 (Core)
postfix 2.10.1
dovecot 2.2.10
mysql 5.7.22
php 7.1.18
mailman 2.1.26+j1p1

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

Jun 27 17:02:42 www postfix/smtp[5763]: 93128161C76: to=testml01@www.localdomain, orig_to=testml01@list.example.com, relay=none, delay=0.42, delays=0.4/0.01/0.01/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=www.localdomain type=A: Host not found)

POSTFIX_STYLE_VIRTUAL_DOMAINS = ['list.example.com'] と設定しているので、/etc/mailman/virtual-mailmantestml01@list.example.com → testml01 (ドメインなし) に変換され、$mydomain が補完されて testml01@www.localdomain となっているものと思います。
mydestination にも、transport_maps にも www.localdomain が含まれていないので、外部宛の扱いとなります(DNS MX, A レコードを探して失敗)。

POSTFIX_STYLE_VIRTUAL_DOMAINS を設定せず、mydestination に list.example.com を含めるのではダメなのですか?

###(2018/06/28) 12:11 追記
mm_cfg.pyadd_virtualhost('list.example.com','list.example.com') は必要。

main.cfvirtual_alias_maps から "hash:/etc/mailman/virtual-mailman" を削除して、testml01@list.example.comtestml01@www.localdomain の変換を止めます。

list.example.com を local 配送にするには、mydestination でも transport_maps でもどちらでも可能。
ただし、transport_maps を使う場合、relay_domains = list.example.com などでドメインを転送許可しないと、RCPT TO のところで受け入れ拒否されてしまうと思います。

あとは、alias_maps = hash:/etc/mailman/aliases, hash:/etc/aliases として、mailman プログラムに渡します。

###(2018/06/28) 17:50 追記
mydestination で解決したようですが。
もし、virtual_alias_domains, virtual_mailbox_domains を変更できないのであれば、mm_cfg.py で VIRTUAL_MAILMAN_LOCAL_DOMAIN を設定し、左辺=右辺となるように virtual-mailman を作成すれば、@list.example.com を変換せずにメールアドレスの存在確認ができると思います。
その後、transport_maps で local へ、alias_maps で mailman に渡します。

(mm_cfg.py) POSTFIX_STYLE_VIRTUAL_DOMAINS = ['list.example.com'] VIRTUAL_MAILMAN_LOCAL_DOMAIN = 'list.example.com' add_virtualhost('list.example.com','list.example.com') (main.cf) alias_maps = hash:/etc/mailman/aliases, hash:/etc/aliases 他、mydestination, virtual_alias_maps, transport_maps などは質問文のまま

投稿2018/06/27 09:57

編集2018/06/28 08:50
TaichiYanagiya

総合スコア12141

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

TaichiYanagiya

2018/06/27 10:05

mailman は最終的には /etc/mailman/aliases (postfix main.cf の alias_maps に設定) で処理する必要があるので、postfix の local 扱いにする必要があります。
leo

2018/06/28 02:58

TaichiYanagiyaさま この度もご回答いただき誠にありがとうございます。 一旦ご提案いただきました内容にて設定してみましたが状況が変わらなかったため、再度ご教授いただけますでしょうか。 ご提案内容と異なることをしておりましたら、申し訳ございません。 /etc/postfix/main.cf ---------------------------------------------------------------- mydestination = list.example.com ---------------------------------------------------------------- /etc/mailman/mm_cfg.py ---------------------------------------------------------------- #POSTFIX_VIRTUAL_DOMAIN = ['list.example.com'] #POSTFIX_STYLE_VIRTUAL_DOMAINS = ['list.example.com'] #add_virtualhost('list.example.com','list.example.com') ---------------------------------------------------------------- /var/log/maillog ---------------------------------------------------------------- Jun 28 11:30:26 www postfix/qmgr[15714]: 942F6161C21: from=<postmaster@example.com>, size=2534, nrcpt=1 (queue active) Jun 28 11:30:26 www postfix/smtpd[15731]: disconnect from xxx-xxx-xxx-xxx.cidr.provider.ne.jp[xxx.xxx.xxx.xxx] Jun 28 11:30:26 www postfix/smtp[15738]: 942F6161C21: to=<testml01@www.localdomain>, orig_to=<testml01@list.example.com>, relay=none, delay=0.19, delays=0.16/0.01/0.01/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=www.localdomain type=A: Host not found) Jun 28 11:30:27 www postfix/cleanup[15737]: 64B72161C8A: message-id=<20180628023027.64B72161C8A@www.localdomain> Jun 28 11:30:27 www postfix/bounce[15739]: 942F6161C21: sender non-delivery notification: 64B72161C8A Jun 28 11:30:27 www postfix/qmgr[15714]: 64B72161C8A: from=<>, size=5422, nrcpt=1 (queue active) Jun 28 11:30:27 www postfix/qmgr[15714]: 942F6161C21: removed ---------------------------------------------------------------- バーチャルの設定の場合、 ---------------------------------------------------------------- mydestination = ---------------------------------------------------------------- として$myhostname, localhost.$mydomain, localhost, $mydomain等を指定しないようなことが書いており、transport_maps=hash:/etc/postfix/transportで、該当メーリングリストをlocalにする形で行けるのかなと思っておりましたが、ご指摘いただきましたとおり、うまく動作してないようです。 そもそもの部分で、ここが間違っている、この設定をまず確認等ございましたら、お知らせいただけますと幸いです。 お忙しいところ大変恐縮ではございますがよろしくお願いいたします。
leo

2018/06/28 05:00

TaichiYanagiyaさま 早速のお返事ありがとうございます。 いただきました設定情報をもとにコンフィグを修正し、systemctl reload postfix mailmanして再送信してみましたが、私の設定の仕方が悪いようで、transport_mapsからlocal配送となっていないようで、そのまま、virtual配送しようとしており、mailmanにメールデータがうまく渡らず送信エラーとなりました。 修正したコンフィグデータ等は以下の通りでございますが、お気づきの点がございましたらご指摘いただけますでしょうか。 何度も確認のお願いとなり大変恐縮ではございますが、何卒宜しくお願い致します。 /var/log/maillog ---------------------------------------------------------------- Jun 28 13:33:05 www postfix/smtpd[1344]: NOQUEUE: reject: RCPT from xxx-xxx-xxx-xxx.cidr.provider.ne.jp[xxx.xxx.xxx.xxx]: 550 5.1.1 <testml01@list.example.com>: Recipient address rejected: User unknown in virtual mailbox table; from=<postmaster@example.com> to=<testml01@list.example.com> proto=ESMTP helo=<[192.168.0.2]> Jun 28 13:33:08 www postfix/smtpd[1344]: disconnect from xxx-xxx-xxx-xxx.cidr.provider.ne.jp[xxx.xxx.xxx.xxx] ---------------------------------------------------------------- /etc/postfix/main.cf ---------------------------------------------------------------- mydestination = alias_maps = hash:/etc/mailman/aliases,hash:/etc/aliases virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf, regexp:/etc/postfix/virtual relay_domains = list.example.com transport_maps=hash:/etc/postfix/transport ---------------------------------------------------------------- /etc/mailman/mm_cfg.py ---------------------------------------------------------------- #POSTFIX_VIRTUAL_DOMAIN = ['list.example.com'] #POSTFIX_STYLE_VIRTUAL_DOMAINS = ['list.example.com'] add_virtualhost('list.example.com','list.example.com') ---------------------------------------------------------------- /etc/mailman/aliases ---------------------------------------------------------------- # The ultimate loop stopper address mailman-loop: /var/lib/mailman/data/owner-bounces.mbox # STANZA START: testml01 # CREATED: Mon Jun 25 17:07:59 2018 testml01: "|/usr/lib/mailman/mail/mailman post testml01" testml01-admin: "|/usr/lib/mailman/mail/mailman admin testml01" testml01-bounces: "|/usr/lib/mailman/mail/mailman bounces testml01" testml01-confirm: "|/usr/lib/mailman/mail/mailman confirm testml01" testml01-join: "|/usr/lib/mailman/mail/mailman join testml01" testml01-leave: "|/usr/lib/mailman/mail/mailman leave testml01" testml01-owner: "|/usr/lib/mailman/mail/mailman owner testml01" testml01-request: "|/usr/lib/mailman/mail/mailman request testml01" testml01-subscribe: "|/usr/lib/mailman/mail/mailman subscribe testml01" testml01-unsubscribe: "|/usr/lib/mailman/mail/mailman unsubscribe testml01" # STANZA END: testml01 # STANZA START: mailman # CREATED: Mon Jun 25 17:07:59 2018 mailman: "|/usr/lib/mailman/mail/mailman post mailman" mailman-admin: "|/usr/lib/mailman/mail/mailman admin mailman" mailman-bounces: "|/usr/lib/mailman/mail/mailman bounces mailman" mailman-confirm: "|/usr/lib/mailman/mail/mailman confirm mailman" mailman-join: "|/usr/lib/mailman/mail/mailman join mailman" mailman-leave: "|/usr/lib/mailman/mail/mailman leave mailman" mailman-owner: "|/usr/lib/mailman/mail/mailman owner mailman" mailman-request: "|/usr/lib/mailman/mail/mailman request mailman" mailman-subscribe: "|/usr/lib/mailman/mail/mailman subscribe mailman" mailman-unsubscribe: "|/usr/lib/mailman/mail/mailman unsubscribe mailman" # STANZA END: mailman ---------------------------------------------------------------- /etc/postfix/transport ---------------------------------------------------------------- testml01@list.example.com local ----------------------------------------------------------------
TaichiYanagiya

2018/06/28 07:37

> Recipient address rejected: User unknown in virtual mailbox table virtual_alias_domains または virtual_mailbox_domains に "list.example.com" が含まれているのだと思います。 含まれている場合、virtual_alias_maps, virtual_mailbox_maps でメールアドレスの存在確認を行ない、存在しなければ拒否します。 postfixadmin 側でも "list.example.com" ドメインを扱っているのでしょうか? もし、postfixadmin で "list.example.com" を扱っていないのであれば、transport_maps, relay_domains ではなく、mydestination に設定する方法を検討ください。
leo

2018/06/28 08:30

TaichiYanagiyaさま ご回答ありがとうございます。 おっしゃる通り、postfixadminにてlist.example.comを作成しておりました。 mailman構築の最初に参考にした記事の手順にドメインのみliist.example.comをpostfixadminで作成するとあったので実施したまま、存在を忘れておりました。 こちらの情報の提示が不十分で大変なお手間をおかけいたしました。 example.comでのmailmanの構築も挑戦していきたいですが、うまくいかなかった場合に改めて相談させてください。 postfixadminで作成したlist.example.comドメインを削除することにより無事メーリングリスト先に送信できましたので、本件はcloseとさせていただきます。 この度は解決していただき本当にありがとうございます。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問