外部からのsmtps(465ポート)が繋がりません。25番smtpはokで、ローカルからはいずれもokです。
LAN内部用メールサーバとしてCentOS+postfix+Dovecot+Opendkimでsmtp(s)&pop3を作ろうとしています。
ところが受信は問題がないのですが、 送信ではsmtp(25ポート)は問題がなく、smtps(465ポート)ではpostfixの手前で立ち往生しています。
ローカルからは465番へは通信できています。
この間、何台かほぼ同じ構成でメールサーバを作っているのですが、理由がよくわかりません。基本的な設定を忘れてしまったのでしょうか。
まずpostfixの設定内容ですが、
# postconf -n alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases 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 = all mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man message_size_limit = 10485760 milter_default_action = accept mydestination = name1.email.com,ns.email.com,name2.email.com,localhost myhostname = ns.email.com mynetworks = 192.128.0.0/16,192.118.3.0/24,192.124.0.0/16,127.0.0.0/8,192.120.0.0/16,192.130.0.0/16,192.119.1.0/24,192.116.1.0/24,192.119.8.0/24,192.129.0.0/16 myorigin = $myhostname newaliases_path = /usr/bin/newaliases.postfix non_smtpd_milters = inet:localhost:8891 queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES relayhost = sample_directory = /usr/share/doc/postfix-2.10.1/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt 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_local_domain = $myhostname smtpd_sasl_security_options = noanonymous unknown_local_recipient_reject_code = 550
465番ポート自体はmaster.cfの設定で開いています。
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port udp UNCONN 0 0 *:10000 *:* users:(("miniserv.pl",pid=4944,fd=5)) udp UNCONN 0 0 127.0.0.1:323 *:* users:(("chronyd",pid=4384,fd=1)) udp UNCONN 0 0 ::1:323 :::* users:(("chronyd",pid=4384,fd=2)) tcp LISTEN 0 100 *:110 *:* users:(("dovecot",pid=4711,fd=24)) tcp LISTEN 0 100 *:143 *:* users:(("dovecot",pid=4711,fd=36)) tcp LISTEN 0 128 *:10000 *:* users:(("miniserv.pl",pid=4944,fd=4)) tcp LISTEN 0 100 *:465 *:* users:(("master",pid=4765,fd=18)) tcp LISTEN 0 128 *:22 *:* users:(("sshd",pid=4662,fd=3)) tcp LISTEN 0 100 *:25 *:* users:(("master",pid=4765,fd=13)) tcp LISTEN 0 128 127.0.0.1:8891 *:* users:(("opendkim",pid=5103,fd=3)) tcp ESTAB 0 448 192.128.1.111:22 192.124.0.199:4966 users:(("sshd",pid=4768,fd=3)) tcp LISTEN 0 100 :::465 :::* users:(("master",pid=4765,fd=19)) tcp LISTEN 0 128 :::22 :::* users:(("sshd",pid=4662,fd=4)) tcp LISTEN 0 100 :::25 :::* users:(("master",pid=4765,fd=14))
また、firewalld並びにselinuxは止めています。
#sestatus SELinux status: disabled
# service firewalld status Active: inactive (dead)
ローカルから465にアクセスするとコネクトし、ログも残ります。
# telnet localhost 465 Trying ::1... Connected to localhost. Escape character is '^]'. 220 ns.email.com ESMTP unknown
smtpには正常にログインし、SSL通信で送信はできているようです。
maillog maillog Feb 26 16:51:16 nsmailsv postfix/smtps/smtpd[5380]: timeout after CONNECT from localhost[::1]
一方外からアクセスすると
telnet 192.128.1.111 465 接続中の状態で何も表示されない maillogには記録なし
25番ポートでは正常です。
Feb 26 16:50:50 nsmailsv postfix/smtp[5390]: connect to gmail-smtp-in.l.google.com[2404:6800:4008:c00::1b]:25: Network is unreachable Feb 26 16:50:51 nsmailsv postfix/smtp[5390]: Trusted TLS connection established to gmail-smtp-in.l.google.com[108.177.97.26]:25: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits) Feb 26 16:50:52 nsmailsv postfix/smtp[5390]: 330412086CFA: to=<user@gmail.com>, relay=gmail-smtp-in.l.google.com[108.177.97.26]:25, delay=2.6, delays=0.1/0.02/1.4/1.1, dsn=2.0.0, status=sent (250 2.0.0 OK 1551167452 o8si11629987plk.273 - gsmtp)

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