I have configured in my app.yml the mail to be something like
DISCOURSE_SMTP_ADDRESS: mail.mysecrect.tld
DISCOURSE_SMTP_PORT: 465
DISCOURSE_SMTP_USER_NAME: minegenix@mysecret.tld
DISCOURSE_SMTP_PASSWORD: <secret>
A user, Sprisa, is experiencing email issues with Discourse configured behind a reverse proxy, using Mailcow as their mail server. They’ve set up SMTP with a domain placeholder and port 465, but encounter a “execution expired” error in logs. The community suggests adjusting DISCOURSE_SMTP_ENABLE_START_TLS to false, using internal IPs (like 172.17.0.1), and configuring DISCOURSE_SMTP_OPENSSL_VERIFY_MODE to none. The discussion reveals potential DNS resolution issues, as getent hosts shows IPv6 addresses for the mail server, and the user cannot establish a connection via openssl. The user confirms their Discourse container’s IP is 172.17.0.2, prompting questions about whether Mailcow is on the same internal Docker network and if it’s configured to accept connections from this IP. The user also asks for recommendations on alternative mail services for Ubuntu. rrit provides a detailed debugging guide for SMTP connections within the Discourse container, while IAmGav and Sprisa contribute to the troubleshooting process. Sprisa seeks help on accessing the Mailcow container, and rrit suggests consulting the Mailcow community. Sprisa also asks for recommendations on alternative mail services.
I have configured in my app.yml the mail to be something like
DISCOURSE_SMTP_ADDRESS: mail.mysecrect.tld
DISCOURSE_SMTP_PORT: 465
DISCOURSE_SMTP_USER_NAME: minegenix@mysecret.tld
DISCOURSE_SMTP_PASSWORD: <secret>
Also found this on logs:
fail
Delivered mail 3ff63fed-4142-4042-ab33-29493b32b3a6@beta2.mysecret.tld (30001.9ms)
Job exception: execution expired
you might need to add this to your app.yml
DISCOURSE_SMTP_ENABLE_START_TLS: false
Okay, btw i use mailcow!
Is the server running discourse beta2.mysecret.tld - and not mysecret.tld?
Give these options a try:
DISCOURSE_SMTP_ADDRESS: 172.17.0.1 # use internal ip here - mail-server domain might not get resolved correctly
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: "YOUR-SMTP-USER-NAME"
DISCOURSE_SMTP_PASSWORD: "YOUR-SMTP-PASSWORD"
#DISCOURSE_SMTP_ENABLE_START_TLS: true # (optional, default true)
DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none
DISCOURSE_SMTP_DOMAIN: mysecret.tld
mysecret.tld is just placeholder hiding my real domain as i don’t want to reveal my forum address ![]()
Are you sending mails with sender email like “…@ beta2. mysecret.tld” - but your mailcow account is for “…@mysecret.tld”?
no im sending emails from …@ mysecret.tld and the site is running at beta2.mysecret.tld
yeah im currently doing that
btw do i need to bootstrap everytime after rebuild?
Okay i added the settings, didn’t help.
./launcher enter app
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
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
![]()
( ifconfig , ip etc. are not installed inside the container.)
hostname -I
Result like:
172.17.0.2
I can’t get connection with openssl, also i only get this: from the getent
2606:4700:3032::ac43:d2f1 mail.secret.tdl
2606:4700:3033::6815:4db8 mail.secret.tld
(secret.tld replacing my actual domain)
A shot in the dark: Is this a public IP? Is your mailcow configured to listen for smtp-connections on this public IP or only on an internal network?
Inside the Discourse container you can get your containers IP via:
hostname -I
Is your mailcow also on the same internal (docker-)network?
172.17.0.2 is the thing i get from hostname -I
Can you get into your mailcow container and also get hostname -I? Are Mailcow and Discourse two seperate docker-containers on the same host?
how do i get into the mailcow container? there isn’t launcher script.
I don’t know about mailcow either. Maybe better check back with the mailcow community: https://community.mailcow.email/
What should i use to get mail systems, or what software can I setup on ubuntu that would work as mail service on my forums?