I recently went through the emails:task and related code with the aim of testing each of the failure codepaths and touching up the error text.
I also discovered that the effects of setting DISCOURSE_SMTP_ENABLE_STARTTLS=false are (mostly) nil. Setting this didn’t actually disable STARTTLS and in fact, it can coexist just fine with tls at connect time (DISCOURSE_SMTP_FORCE_TLS=true).
So I’ve:
- removed the code that prevents both from being set: DEV: Revamp email check by Supermathie · Pull Request #35634 · discourse/discourse · GitHub
- fixed the code to actually disable STARTTLS when requested: DEV: Revamp email check by Supermathie · Pull Request #35634 · discourse/discourse · GitHub
- redone the code that looks for failures and updated the text: DEV: Revamp email check by Supermathie · Pull Request #35634 · discourse/discourse · GitHub
Before I merge this though, I think an admin warning in the dashboard for when DISCOURSE_SMTP_ENABLE_STARTTLS=false is being set is suitable. I imagine there’s at least one self-hoster out there who has set this but doesn’t need it and is actually relying on STARTTLS.