前提・実現したいこと
VMware上のCentOS6にて、サーバ構築練習の一環として、PostfixとDovecotで初めてメールサーバを構築している者です。
内部での送信・受信、内部→外部への送信はできるのですが、外部(GmailやYahoo!メールなど)→内部への受信ができず、詰まってしまっています。
ドメインの取得、MXレコード等についてはMyDNSで行なっています。
発生している問題・エラーメッセージ
Gmailから数時間~1日後に返送されてくるエラーメッセージ
配信未完了 testuser@example.mydns.jp へのメールの配信中に一時的な問題が発生しました。Gmail は XX 時間再試行し、配信できなかった場合はお知らせします。 応答: The recipient server did not accept our requests to connect. Learn more at https://support.google.com/mail/answer/7720 [testuser@example.mydns.jp 192.168.x.xxx: timed out]
該当のソースコード
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 = 1 home_mailbox = Maildir/ html_directory = no inet_interfaces = all inet_protocols = ipv4 lmtp_tls_loglevel = 2 local_recipient_maps = mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain mydomain = example.mydns.jp myhostname = mail.example.mydns.jp mynetworks = 127.0.0.0/8, 192.168.0.0/24 myorigin = $mydomain newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES relayhost = [smtp.gmail.com]:587 sample_directory = /usr/share/doc/postfix-2.6.6/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtp_sasl_auth_enable = yes smtp_sasl_mechanism_filter = plain smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_tls_security_options = noanonymous smtp_tls_CApath = /etc/pki/tls/certs/ca-bundle.crt smtp_tls_loglevel = 1 smtp_use_tls = yes smtpd_banner = $myhostname ESMTP smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination smtpd_sasl_auth_enable = yes smtpd_sasl_path = private/auth smtpd_sasl_type = dovecot smtpd_tls_loglevel = 1 unknown_local_recipient_reject_code = 550
doveconf -n
auth_debug = yes auth_debug_passwords = yes auth_mechanisms = plain login auth_verbose = yes disable_plaintext_auth = no listen = * log_path = /var/log/dovecot.log mail_debug = yes mail_location = maildir:~/Maildir mbox_write_locks = fcntl passdb { driver = pam } protocols = imap pop3 service auth { unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0666 user = postfix } } ssl = no ssl_cert = </etc/pki/dovecot/certs/dovecot.pem ssl_key = </etc/pki/dovecot/private/dovecot.pem userdb { driver = passwd }
netstat -nat(ポート25番の開放チェック)
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN
dig example.mydns.jp
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.68.rc1.el6_10.7 <<>> example.mydns.jp ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13988 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;example.mydns.jp. IN A ;; ANSWER SECTION: example.mydns.jp. 300 IN A 192.168.x.xxx ;; Query time: 408 msec ;; SERVER: xxx.xxx.xx.xxx#53(xxx.xxx.xx.xxx) ;; WHEN: Fri Jun 12 20:35:36 2020 ;; MSG SIZE rcvd: 51
dig example.mydns.jp mx
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.68.rc1.el6_10.7 <<>> example.mydns.jp mx ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42672 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;example.mydns.jp. IN MX ;; ANSWER SECTION: example.mydns.jp. 300 IN MX 10 mail.example.mydns.jp. ;; Query time: 73 msec ;; SERVER: xxx.xxx.xx.xxx#53(xxx.xxx.xx.xxx) ;; WHEN: Fri Jun 12 20:37:27 2020 ;; MSG SIZE rcvd: 56
補足情報
SSLに関しては、送受信ができてから設定する予定なので、今のところ何も設定していません。
maillogには何も記録されていないことから、そもそもGmail側からサーバに到達していないのではないかと考えています。
MXレコードの設定方法などがよく理解できておらず、そのあたりの設定がおかしいのかもしれません。
IPアドレスをプライベートIPアドレスで登録してしまっているのも怪しい気がします。内部→外部へ送信できていたので、問題ないのかと思っていたのですが…。ただ、MyDNSにグローバルIPアドレスで登録しても状況は変わらなかったので、よくわかりません…。
サーバは25番ポートを開放できているようなので、ルータのポートも開放しているのですが、それでもうまくいきませんでした。チェックテストを行うと、「ポート開放されていません」「到達できませんでした」といった内容の結果が出ます。
telnetでメールの送受信はできています。が、TLSで自分のGmailから送ると、一見問題なく送信完了しますが、結局メールは届きません。ログにも何も残らないので、何が問題なのかがわかりません。
数日間詰まってしまい、どうしても自分の力では解決できそうにないので、お力をお借りしたいです。
エラー内容などで検索しても、「DNSの更新情報の反映に時間がかかる」という意見もあり、しばらく様子を見るべきなのか、こちらで直せるところがあるのかをはっきりさせたいです。
不勉強で恐縮ですが、どなたかご教示いただければ幸いです。よろしくお願いいたします。

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/06/13 08:16
2020/06/13 11:46