localhostの25番に接続できない
ローカルホストからメールを送信する必要があり、telnet 25するとこんなエラー。
$ telnet localhost 25 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Connection closed by foreign host.
なぜだ。service --status-allでチェックするとPostfixは稼動状態。
syslogをチェックするとこんなエラーがでている。
Oct 4 14:41:19 ishtar stunnel: LOG5[2]: Service [gmail-smtp] accepted connection from 127.0.0.1:47482 Oct 4 14:41:19 ishtar stunnel: LOG5[2]: s_connect: connected 64.233.189.108:465 Oct 4 14:41:19 ishtar stunnel: LOG5[2]: Service [gmail-smtp] connected remote server from 10.231.1.21:37156 Oct 4 14:41:19 ishtar stunnel: LOG4[2]: CERT: Pre-verification error: unable to get local issuer certificate Oct 4 14:41:19 ishtar stunnel: LOG4[2]: Rejected by CERT at depth=2: C=US, O=GeoTrust Inc., CN=GeoTrust Global CA Oct 4 14:41:19 ishtar stunnel: LOG3[2]: SSL_connect: 14090086: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed Oct 4 14:41:19 ishtar stunnel: LOG5[2]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
なんだこりゃ?
localhostからstunnelで別のところへ接続しようとしている模様。stunnelの設定をチェック。
いました。これだ。
[gmail-smtp] client = yes accept = 127.0.0.1:25 connect = smtp.gmail.com:465 verify = 2 CApath = @sysconfdir/ssl/certs checkHost = smtp.gmail.com OCSPaia = yes
こんあ設定いれた覚えがないなぁ。もしかしたらデフォルトで入ってるのかも。
コメントアウトしたうえで、stunnelを再起動。postfixも再起動して解決。