こんにちは皆さん、
長年続いているフォーラムをphpBB3からDiscourseに切り替えたいと思っています。Dockerの設定は完了し、初期設定にアクセスできます。残念ながらメールが送信されないため、初期設定を完了できません。
デバッグを試みましたが、原因が見つからなかったので、皆さんの助けを借りたいと思います。
私のセットアップは以下の通りです。Apache2をDockerへのリバースプロキシとして設定しており、これは機能しています。メールサーバーは同じマシン上のMailcow Dockerです。メールサーバーは徹底的にテストされており、ポート587でのSTARTTLSとWebメールを介したSMTPで日常的に問題なく動作しています。
app.ymlの設定は以下のようになっています。
DISCOURSE_SMTP_ADDRESS: mail.example.com
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: discourse@example.com
DISCOURSE_SMTP_PASSWORD: "password"
#DISCOURSE_SMTP_ENABLE_START_TLS: true # (optional, default true)
#DISCOURSE_SMTP_DOMAIN: mail.example.com
DISCOURSE_NOTIFICATION_EMAIL: discourse@example.com
./discourse-doctorを実行すると、以下のようになります。
==================== MAIL TEST ====================
For a robust test, get an address from http://www.mail-tester.com/
Or just send a test message to yourself.
Email address for mail test? ('n' to skip) [admin@example.com]:
Sending mail to admin@example.com. . .
Testing sending to admin@example.com using mail.example.com:587, username:discourse@example.com with plain auth.
=======================================
ERROR
=======================================
UNEXPECTED ERROR
Cannot assign requested address - connect(2) for [correct ipv6]:587
=======================================
SOLUTION
=======================================
This is not a common error. No recommended solution exists!
Please report the exact error message above to https://meta.discourse.org/
(And a solution, if you find one!)
Web上で同様のエラーメッセージを持つ人を見つけることができなかったため、このスレッドにたどり着きました。
コンテナ外からtelnetでメールサーバーに簡単に接続できました。
コンテナ内で試したこと:
getent hosts mail.example.com
正しいIPv6アドレスが提供されました。
しかし、その後エラーが発生し始めました:
openssl s_client -connect mail.example.com:587 -starttls smtp
140124593714496:error:0200206E:system library:connect:Connection timed out:../crypto/bio/b_sock2.c:110:
140124593714496:error:2008A067:BIO routines:BIO_connect:connect error:../crypto/bio/b_sock2.c:111:
connect:errno=110
openssl s_client -6 -connect "[correct IPv6]:587" -starttls smtp
139918557709632:error:02002063:system library:connect:Cannot assign requested address:../crypto/bio/b_sock2.c:110:
139918557709632:error:2008A067:BIO routines:BIO_connect:connect error:../crypto/bio/b_sock2.c:111:
connect:errno=99
openssl s_client -connect smtp.gmail.com:587 -starttls smtp
は問題なく動作します。
コンテナ外から
openssl s_client -connect mail.example.com:587 -starttls smtp
を実行すると、これも問題なく動作します。
Mailcow/Postfixのログには何も表示されません。
お手上げです。次にどこを確認すればよいか教えていただけますか?