How to debug issues with first connection to smtp server
1. Enter your container:
./launcher enter app
2. Check dns resolution for your smtp server name via getent hosts:
(dig, nslookup, ping etc. are not installed inside the container.)
getent hosts your.smtp.server
Result on success:
# IPv4
123.123.123.123 your.smtp.server
# IPv6
2001:db8:0:0:0:ff00:42:8329 your.smtp.server
3. Try to open a connection to your smtp server via openssl:
(telnet, nc etc. are not installed inside the container.)
Fiddle with some different settings until you succeed with a connection.
openssl s_client -connect your.smtp.server:465
openssl s_client -connect your.smtp.server:587 -starttls smtp
# IPv4
openssl s_client -connect 172.17.0.123:465
openssl s_client -connect 172.17.0.123:587 -starttls smtp
# IPv6
openssl s_client -6 -connect "[2001:db8:0:0:0:ff00:42:8329]:465"
openssl s_client -6 -connect "[2001:db8:0:0:0:ff00:42:8329]:587" -starttls smtp
See: How to check SMTP connection → Step 3: Checking SMTP Connection Over TLS Using Openssl
4. Use your found working connection settings with Discourse.
![]()
Bonus: show Discourse IP from inside docker container
( ifconfig , ip etc. are not installed inside the container.)
hostname -I
Result like:
172.17.0.2