During the Discourse onboarding process, users are prompted to paste an SMTP password, but if the password contains special characters (e.g., spaces or backslashes), it may be incorrectly wrapped in quotes (e.g., “passwo rd”), causing authentication to fail with the SMTP server. amanintech discovered that manually editing app.yml to remove the quotes and restarting Discourse resolves the issue, and asks if this behavior can be improved. pfaffman notes that while the setup usually works, the underlying sed command in the discourse-setup script is fragile due to regex limitations, and acknowledges amanintech as the first to report this in a while — and praises their ability to fix it. amanintech confirms using a SendGrid-generated password and suspects regex is the culprit; they express willingness to contribute a fix but request guidance on where to start. pfaffman directs them to the discourse-setup script in discourse_docker, suggesting the problematic sed replacement line is the likely culprit, and invites them to propose a fix for review. The issue is not critical but affects edge cases involving special characters in SMTP passwords.
During the onboarding step, we are asked to add an SMTP password where we just plain paste the password. But turns out this fails the authentication as the password is written within "password" which is not what the SMTP server authenticates
So the fix is to manually modify it in app.yml and remove “”, restar discourse and the problem is fixed.
Does your password have backslashes or other characters? It does work as you expect most of the time, but due to the nature of regex and sed it’s a little fragile. You’re the first person in a long while to complain {and you knew how to fix it).
If you can figure out a way to make it work, I’m sure a PR would be accepted (though I don’t make that decision).
I am using the standard method from SendGrid to generate a private password. And I think you right maybe it’s because of certain characters in regex.
I can certainly contribute to this as it’s not a big issue. But I am new to discourse contribution, can you point me in the right direction ( which component handles this functionality ? )