A user, AstonJ, encountered a mail error in their Discourse installation: certificate verify failed (unable to get local issuer certificate), despite the same credentials working on their Mac and iPhone. They temporarily resolved it by disabling TLS verification via DISCOURSE_SMTP_ENABLE_START_TLS: false and DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none, but suspected a bug since the issue didn’t occur elsewhere. packman clarified that the issue stems from Discourse failing to negotiate TLS with the mail server, unlike mobile devices which may use different servers or handle TLS correctly. AstonJ confirmed both devices used the same mail server and that a manual SMTP test succeeded, raising questions about how closely it mirrors Discourse’s behavior. sam warned against disabling security and suggested checking server time or incomplete SSL libraries. AstonJ confirmed correct time and questioned which SSL libraries Discourse requires, noting Apple Mail’s strictness and considering DNS propagation as a possible factor. Ultimately, AstonJ resolved the issue by realizing they had forgotten to configure chain.pem in Postfix — a critical SSL certificate chain file needed for proper TLS validation. The case highlights the importance of complete SSL certificate setup in mail servers when integrating with Discourse.
Set up a discourse install on a new server and had issues with mail (certificate verify failed (unable to get local issuer certificate)) even though I could send/receive email from the same address via my Mac and iPhone (without it complaining about certs or anything like that).
The error you’ve seen is related to the mail protocol and isn’t address specific. For some reason your Discourse instance isn’t negotiating a TLS connection with the destination mail server. You’ve fixed it by turning off TLS negotiation during the mail sending connection
When you’re using your phone that’s probably sending the messages through a different server, or if it’s the same destination server then the phone is able to negotiate TLS correctly.
Both Mac and iPhone have been configured to use the same mail.domain server to send mail, and following the test was successful (though I am not sure how closely that replicates what Discourse is doing).
If your clock is way off then certs can appear expired when they are not. It could be that the SSL libraries used by your mail provider are incomplete.
Clicking the “disable security” button is never recommended.
Time on the server is correct Sam. Which SSL libraries does Discourse need the mail server to have?
The thing that makes this odd is that (Apple) Mail is usually very quick to warn of issues, yet the same emails work fine on my Mac.
The only other thing I can think of is DNS propagation because this is a new sever and the email host was slightly different on the old server (but the email is being hosted on the same server as the forum so not convinced this would be the issue).