./discourse-setup が SMTP ユーザー名を SMTP パスワードの先頭に配置する

Yeah. That’s the issue. There are multiple levels of escaping that need to happen, like when bash reads the value, when bash hands the value to sed, when sed replaces it, and then, maybe, when the yml file gets it. It’s a known issue:

I recategorized this as Support.