テストのために、自宅のサーバーでDocker上のDiscourseを使用してホストを設定しようとしています。これまでのところ、うまくいっており、インスタンスはスムーズに動作しています。
しかし、自分のサーバー経由でメールを送信することができません。原則として、サービスプロバイダー経由での送信はうまくいきます。
私は独自のsmtpdを運用しています。しかし、ポートスキャンを制限するために、IPv4経由での送信用の標準ポート465と587を無効にしました。IPv4経由での送信にはポート23456のみが開いています。
./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) [hostmaster@example.com]:
Sending mail to hostmaster@example.com. . .
Testing sending to hostmaster@example.com using smtpd.example.com:23456, username:mbox_hostmaster@example.com with plain auth.
======================================== ERROR ========================================
UNEXPECTED ERROR
Net::ReadTimeout
====================================== 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!)
=======================================================================================
telnetで接続を試みたところ、問題なく接続できました。
root@HomeServer:/Ruby/docker.ruby.discourse# docker exec -t -i 50544a79b91a /bin/bash
root@discourse:/# telnet smtpd.example.com 23456
Trying 1.2.3.4...
Connected to smtpd.example.com.
Escape character is '^]'.
quit
Connection closed by foreign host.
root@discourse:/# exit
app.ymlの実際の構成は以下の通りです。
DISCOURSE_SMTP_ADDRESS: smtpd.example.com
DISCOURSE_SMTP_PORT: 23456
DISCOURSE_SMTP_USER_NAME: mbox_hostmaster@example.com
DISCOURSE_SMTP_PASSWORD: pa$$word
DISCOURSE_SMTP_ENABLE_START_TLS: true # (optional, default true)
#DISCOURSE_SMTP_DOMAIN: discourse.example.com # (required by some providers)
DISCOURSE_NOTIFICATION_EMAIL: no-reply@discourse.example.com # (address to send notifications from)
# DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none
# DISCOURSE_SMTP_AUTHENTICATION: "login"
IPv6経由での動作も試みましたが、うまくいきませんでした。Dockerアプリ内でIPv6接続を有効にするための解決策はありますか?
現在は2024年であり、プロトコルが標準化されてから26年が経過しました。私はシステムをIPv6でセットアップしており、すべてが非常にうまく動作しています。
ご協力ありがとうございます!
Achim