# ./discourse-setup 将 SMTP 用户名放在 SMTP 密码的开头

**URL:** https://meta.discourse.org/t/discourse-setup-puts-smtp-username-at-start-of-smtp-password/381710
**Category:** Support
**Tags:** install
**Created:** [2025 年9 月 5 日 12:37 UTC](https://meta.discourse.org/t/discourse-setup-puts-smtp-username-at-start-of-smtp-password/381710 "2025-09-05T12:37:46Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### 作者： ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### 发布日期： [2025 年9 月 15 日 18:26 UTC](https://meta.discourse.org/t/discourse-setup-puts-smtp-username-at-start-of-smtp-password/381710/7 "2025-09-15T18:26:28Z")

</div>

> [@Ethsim2](#):
>
> 密码包含特殊字符（@、!），但问题不仅仅是 YAML 引号：用户名字符串实际上被连接到了密码的开头。

是的。这就是问题所在。需要发生多个级别的转义，例如当 `bash` 读取值时，当 bash 将值传递给 `sed` 时，当 `sed` 替换它时，然后，也许，当 yml 文件获取它时。这是一个已知问题：

> [@Discourse](#):
>
> 最简单的方法是再次运行 `./discourse-setup`。您输入的一切都正确吗？但等等！如果您的密码包含数字和字母以外的任何字符，您最好使用 `nano` 或您喜欢的编辑器编辑 `app.yml`。

我已将此重新分类为 #support。

---

_[View the full topic](https://meta.discourse.org/t/discourse-setup-puts-smtp-username-at-start-of-smtp-password/381710)._
