I am currently trying to set up a host with Discourse in Docker on my home server for testing it out. It’s working quite well so far, the instance is running smoothly.
However, I can’t manage to send the emails via my own server. In principle, sending via a service provider works.
I’m running a own smtpd in the wild. However, I have deactivated the standard ports 465 and 587 for sending via IPv4 in order to restrict port scans. Only port 23456 is open for sending via IPv4.
A check with
root@HomeServer:/Ruby/docker.ruby.discourse# ./discourse-doctor
results in:
==================== 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!)
=======================================================================================
The I tried to connect via telnet, that’s no problem:
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
The actual configuration in app.yml is:
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"
I also tried to get it running via IPv6 but no chance. Is there any solution to enable IPv6 connectivity within the docker app?
It is now 2024 and 26 years after the protocol was standardized, I have set up my systems with it - everything is running very well.
Thanks for your help!
Achim