I am hosting the Discourse server on DigitalOcean, domain from PorkBun, mail server with MailGun.
My MailGun account is activated and the domain (discourse.mydomain.com) is verified for use with mg.mydomain.com. All the DNS TXT records are in place.
When I try to run discourse-doctor or if I run ./launcher enter app then run rake 'emails:test[mail@mg.mydomain.com]' I get the following error
======================================== ERROR ========================================
UNEXPECTED ERROR
Net::SMTPAuthenticationError
====================================== 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!)
=======================================================================================
Something is broken on Discourse, because I have no trouble sending the mail manually. I have been searching Google and the forums here for many hours, no solutions yet. Any ideas?
Something is wrong with your username/password. It’s possible that your password has a character that needs escaping like a star or a single quote, maybe (so it’ll be easiest to change the password not to include that character).
the password does not contain any of those characters. In fact its the auto-generated password from MailGun, and only has letters and numbers and a few ‘-’ characters. Its quite long.
That was my best guess. I’d try generating a new password and/or copy-pasting it again. The likelihood that this is a bug in Discourse is extremely remote.
I’d wager DISCOURSE_SMTP_USER_NAME is incorrect - mail is probably not enough for mailgun to authenticate you. It should probably be mail@mg.mydomain.com
I’d guess you think DISCOURSE_SMTP_DOMAIN is the domain of the user? It’s not - it’s the EHLO domain. You almost definitely don’t need to set it.
I just realized this as well, when I tested with telnet I used “mail@mg.mydomain.com” as the username and it worked, so I will try it again with that as the DISCOURSE_SMTP_USER_NAME
I’d guess you think DISCOURSE_SMTP_DOMAIN is the domain of the user? It’s not - it’s the EHLO domain. You probably don’t need to set it.
not sure I follow what this means
for MailGun I was using mg.mydomain.com, for Discourse I was using discourse.mydomain.com. I dont actually have any DNS records set at the moment for mydomain.com, only for the Discourse subdomain and the TXT records for the MailGun DNS