Hi people,
I want to switch a long standing forum from phpBB3 to Discourse. I managed to setup the Docker, and am able to access the Initial Setup. Unfortunately there is no mail being sent, so i can’t finish the init.
I did some debugging and cant find the reason, so I am turning to you for help.
My setup is like this, I have setup apache2 as a reverseproxy to the docker, which works. My mailserver is a mailcow docker on the same machine. The mailserver is tested thoroughly and works fine on a daily basis through SMTP with STARTTLS on Port 587 and webmail.
the config in my app.yml looks like this:
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
when i run ./discourse-doctor i get:
==================== 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!)
Being unable to find people with similar error messages on the web, I turned to this thread
I was easily able to connect to the mailserver with telnet from outside the container.
What I tried inside the container:
getent hosts mail.example.com
provided the correct IPv6 Adress
But then the errors started turning up:
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
works just fine
When I try the
openssl s_client -connect mail.example.com:587 -starttls smtp
from outside the container, It works also fine.
My mailcow/postfix logs show nothing…
I am stumped. Can you help me where to look next?