web-dev-qa-db-ja.com

Postfixはメールを送受信できません

サーバー上でdovecotでも実行されているPostFixをセットアップしました。私のサーバーはUbuntu16.04を実行しています。サーバー上で実行されているsquirrelmailからメールを送受信できず、ローカルでもメールを送受信できません。

postconf -nの出力は次のとおりです。

https://Pastebin.com/te6ZU2i4

root@thatmadhacker:/etc# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
canonical_maps = hash:/etc/postfix/canonical
default_destination_concurrency_limit = 5
disable_vrfy_command = yes
dovecot_destination_recipient_limit = 1
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = ipv4
mailbox_size_limit = 0
message_size_limit = 104857600
mydestination = $myhostname, thatmadhacker.org, localhost
myhostname = thatmadhacker.org
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = $myhostname
readme_directory = no
recipient_delimiter = +
relay_destination_concurrency_limit = 1
relayhost =
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP smtpd_helo_required = yes reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, reject_unknown_helo_hostname, permit reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_invalid_hostname, reject_non_fqdn_sender reject_sender_login_mismatch
smtpd_sender_login_maps = $virtual_mailbox_maps
smtpd_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtpd_tls_ask_ccert = yes
smtpd_tls_cert_file = /etc/letsencrypt/live/thatmadhacker.org/cert.pem
smtpd_tls_key_file = /etc/letsencrypt/live/thatmadhacker.org/privkey.pem
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
unknown_address_reject_code = 550
unknown_client_reject_code = 550
unknown_hostname_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_mailbox_domains = hash:/etc/postfix/virtual-mailbox-domains
virtual_mailbox_maps = hash:/etc/postfix/virtual-mailbox-users
virtual_transport = dovecot

また、/var/log/mail.logの内容は次のとおりです。

また、一部のログには[email protected]と記載されていますが、エイリアスファイルで変更するのを忘れており、ログをコピーした後に変更されましたが、同じ問題が解決しません。

https://Pastebin.com/ZaGhUeXc

Sep 23 19:11:53 thatmadhacker postfix/smtp[1877]: connect to alt1.gmail-smtp-in.l.google.com[173.194.66.26]:25: Connection timed out
Sep 23 19:11:53 thatmadhacker postfix/smtp[1878]: connect to alt1.gmail-smtp-in.l.google.com[173.194.66.26]:25: Connection timed out
Sep 23 19:12:23 thatmadhacker postfix/smtp[1877]: connect to alt2.gmail-smtp-in.l.google.com[74.125.31.26]:25: Connection timed out
Sep 23 19:12:23 thatmadhacker postfix/smtp[1878]: connect to alt2.gmail-smtp-in.l.google.com[74.125.31.26]:25: Connection timed out
Sep 23 19:12:53 thatmadhacker postfix/smtp[1877]: connect to alt3.gmail-smtp-in.l.google.com[64.233.186.26]:25: Connection timed out
Sep 23 19:12:53 thatmadhacker postfix/smtp[1878]: connect to alt3.gmail-smtp-in.l.google.com[64.233.186.26]:25: Connection timed out
Sep 23 19:13:23 thatmadhacker postfix/smtp[1877]: connect to alt4.gmail-smtp-in.l.google.com[74.125.193.26]:25: Connection timed out
Sep 23 19:13:23 thatmadhacker postfix/smtp[1878]: connect to alt4.gmail-smtp-in.l.google.com[74.125.193.26]:25: Connection timed out
Sep 23 19:13:24 thatmadhacker postfix/smtp[1877]: 092A3811F6: to=<[email protected]>, relay=none, delay=3651, delays=3501/0.02/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[74.125.193.26]:25: Connection timed out)
Sep 23 19:13:24 thatmadhacker postfix/smtp[1878]: 0DFD7811ED: to=<[email protected]>, relay=none, delay=4328, delays=4178/0.02/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[74.125.193.26]:25: Connection timed out)
Sep 23 19:20:53 thatmadhacker postfix/qmgr[31700]: A14CE811EA: from=<[email protected]>, size=749, nrcpt=1 (queue active)
Sep 23 19:21:23 thatmadhacker postfix/smtp[3001]: connect to gmail-smtp-in.l.google.com[173.194.197.26]:25: Connection timed out
Sep 23 19:21:53 thatmadhacker postfix/smtp[3001]: connect to alt1.gmail-smtp-in.l.google.com[173.194.66.27]:25: Connection timed out
Sep 23 19:22:23 thatmadhacker postfix/smtp[3001]: connect to alt2.gmail-smtp-in.l.google.com[172.217.193.26]:25: Connection timed out
Sep 23 19:22:53 thatmadhacker postfix/smtp[3001]: connect to alt3.gmail-smtp-in.l.google.com[64.233.186.27]:25: Connection timed out
Sep 23 19:23:23 thatmadhacker postfix/smtp[3001]: connect to alt4.gmail-smtp-in.l.google.com[74.125.193.27]:25: Connection timed out
Sep 23 19:23:23 thatmadhacker postfix/smtp[3001]: A14CE811EA: to=<[email protected]>, relay=none, delay=8062, delays=7912/0.02/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[74.125.193.27]:25: Connection timed out)
Sep 23 19:25:53 thatmadhacker postfix/qmgr[31700]: 82EB4811F7: from=<[email protected]>, size=757, nrcpt=1 (queue active)
Sep 23 19:25:53 thatmadhacker postfix/qmgr[31700]: 81E8D811F3: from=<[email protected]>, size=899, nrcpt=1 (queue active)
Sep 23 19:26:23 thatmadhacker postfix/smtp[3392]: connect to nullmx.domainmanager.com[45.63.18.247]:25: Connection timed out
Sep 23 19:26:23 thatmadhacker postfix/smtp[3391]: connect to gmail-smtp-in.l.google.com[64.233.183.27]:25: Connection timed out
Sep 23 19:26:23 thatmadhacker postfix/smtp[3392]: 81E8D811F3: to=<[email protected]>, orig_to=<[email protected]>, relay=none, delay=6266, delays=6236/0.03/30/0, dsn=4.4.1, status=deferred (connect to nullmx.domainmanager.com[45.63.18.247]:25: Connection timed out)
Sep 23 19:26:53 thatmadhacker postfix/smtp[3391]: connect to alt1.gmail-smtp-in.l.google.com[173.194.66.26]:25: Connection timed out
Sep 23 19:27:23 thatmadhacker postfix/smtp[3391]: connect to alt2.gmail-smtp-in.l.google.com[172.217.193.26]:25: Connection timed out
Sep 23 19:27:53 thatmadhacker postfix/smtp[3391]: connect to alt3.gmail-smtp-in.l.google.com[64.233.186.27]:25: Connection timed out
Sep 23 19:28:23 thatmadhacker postfix/smtp[3391]: connect to alt4.gmail-smtp-in.l.google.com[74.125.193.27]:25: Connection timed out
Sep 23 19:28:23 thatmadhacker postfix/smtp[3391]: 82EB4811F7: to=<[email protected]>, relay=none, delay=3401, delays=3251/0.02/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[74.125.193.27]:25: Connection timed out)
Sep 23 19:50:53 thatmadhacker postfix/qmgr[31700]: 8BC4A811EC: from=<[email protected]>, size=1064, nrcpt=1 (queue active)
Sep 23 19:50:53 thatmadhacker postfix/qmgr[31700]: 96302811EB: from=<[email protected]>, size=1068, nrcpt=1 (queue active)
Sep 23 19:51:24 thatmadhacker postfix/smtp[5374]: connect to nullmx.domainmanager.com[45.63.18.247]:25: Connection timed out
Sep 23 19:51:24 thatmadhacker postfix/smtp[5375]: connect to nullmx.domainmanager.com[45.63.18.247]:25: Connection timed out
Sep 23 19:51:24 thatmadhacker postfix/smtp[5374]: 8BC4A811EC: to=<[email protected]>, orig_to=<postmaster>, relay=none, delay=10049, delays=10019/0.02/30/0, dsn=4.4.1, status=deferred (connect to nullmx.domainmanager.com[45.63.18.247]:25: Connection timed out)
Sep 23 19:51:24 thatmadhacker postfix/smtp[5375]: 96302811EB: to=<[email protected]>, orig_to=<postmaster>, relay=none, delay=10077, delays=10047/0.02/30/0, dsn=4.4.1, status=deferred (connect to nullmx.domainmanager.com[45.63.18.247]:25: Connection timed out)
Sep 23 19:55:53 thatmadhacker postfix/qmgr[31700]: BC6D1811EE: from=<[email protected]>, size=907, nrcpt=1 (queue active)
Sep 23 19:55:53 thatmadhacker postfix/qmgr[31700]: D92C3811F2: from=<[email protected]>, size=898, nrcpt=1 (queue active)
Sep 23 19:56:23 thatmadhacker postfix/smtp[5788]: connect to nullmx.domainmanager.com[45.63.18.247]:25: Connection timed out
Sep 23 19:56:23 thatmadhacker postfix/smtp[5789]: connect to nullmx.domainmanager.com[45.63.18.247]:25: Connection timed out
Sep 23 19:56:23 thatmadhacker postfix/smtp[5788]: BC6D1811EE: to=<[email protected]>, orig_to=<[email protected]>, relay=none, delay=9757, delays=9726/0.02/30/0, dsn=4.4.1, status=deferred (connect to nullmx.domainmanager.com[45.63.18.247]:25: Connection timed out)
Sep 23 19:56:23 thatmadhacker postfix/smtp[5789]: D92C3811F2: to=<[email protected]>, orig_to=<[email protected]>, relay=none, delay=8438, delays=8408/0.03/30/0, dsn=4.4.1, status=deferred (connect to nullmx.domainmanager.com[45.63.18.247]:25: Connection timed out)
Sep 23 20:05:53 thatmadhacker postfix/qmgr[31700]: 8B9FE811F0: from=<[email protected]>, size=899, nrcpt=1 (queue active)
Sep 23 20:05:53 thatmadhacker postfix/qmgr[31700]: AB967811EF: from=<[email protected]>, size=899, nrcpt=1 (queue active)
Sep 23 20:06:23 thatmadhacker postfix/smtp[6557]: connect to nullmx.domainmanager.com[45.63.18.247]:25: Connection timed out
Sep 23 20:06:23 thatmadhacker postfix/smtp[6556]: connect to nullmx.domainmanager.com[45.63.18.247]:25: Connection timed out
Sep 23 20:06:23 thatmadhacker postfix/smtp[6557]: AB967811EF: to=<[email protected]>, orig_to=<[email protected]>, relay=none, delay=9554, delays=9524/0.03/30/0, dsn=4.4.1, status=deferred (connect to nullmx.domainmanager.com[45.63.18.247]:25: Connection timed out)
Sep 23 20:06:23 thatmadhacker postfix/smtp[6556]: 8B9FE811F0: to=<[email protected]>, orig_to=<[email protected]>, relay=none, delay=9552, delays=9522/0.03/30/0, dsn=4.4.1, status=deferred (connect to nullmx.domainmanager.com[45.63.18.247]:25: Connection timed out)
Sep 23 20:15:53 thatmadhacker postfix/qmgr[31700]: 388D4811F1: from=<[email protected]>, size=899, nrcpt=1 (queue active)
Sep 23 20:15:53 thatmadhacker postfix/qmgr[31700]: 092A3811F6: from=<[email protected]>, size=759, nrcpt=1 (queue active)
Sep 23 20:15:53 thatmadhacker postfix/qmgr[31700]: 7EAA1811E9: from=<[email protected]>, size=730, nrcpt=1 (queue active)
Sep 23 20:16:23 thatmadhacker postfix/smtp[7376]: connect to nullmx.domainmanager.com[45.63.18.247]:25: Connection timed out
Sep 23 20:16:23 thatmadhacker postfix/smtp[7377]: connect to gmail-smtp-in.l.google.com[64.233.183.26]:25: Connection timed out
Sep 23 20:16:23 thatmadhacker postfix/smtp[7378]: connect to gmail-smtp-in.l.google.com[64.233.183.26]:25: Connection timed out
Sep 23 20:16:23 thatmadhacker postfix/smtp[7376]: 388D4811F1: to=<[email protected]>, orig_to=<[email protected]>, relay=none, delay=9951, delays=9921/0.02/30/0, dsn=4.4.1, status=deferred (connect to nullmx.domainmanager.com[45.63.18.247]:25: Connection timed out)

編集:私もチェックし、サーバーはポート25を介して通信できます。また、サーバーからGmailメールサーバーに手動で接続すると、これが発生します。

telnet alt4.gmail-smtp-in.l.google.com 25
Trying 2a00:1450:400b:c01::1b...
Connected to alt4.gmail-smtp-in.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP k14-v6si14677187wmd.98 - gsmtp
1
User9124

エラー recipient-MX-hostname[ip-address]:25: Connection timed outは、送信SMTPトラフィックがファイアウォールによってブロックされていることを示しているようです。

多くの(消費者)ISPは送信メールトラフィックを許可せず、SMTPポート25をブロックし、メールリレーの使用を要求するため、独自のファイアウォールを確認するか、インターネットプロバイダーのドキュメントを参照してください。

1
HBruijn