恢复备份后所有邮件功能被禁用?

I wanted to do some testing with Discourse so I took a backup of my instance, wiped the DB (rm -fr /var/discourse/shared) and rebuilt the container.

I then created an admin user again and instead of following the setup wizard I went straight to admin, enabled restores, uploaded the backup and restored.

For whatever reason the outgoing email is disabled by an administrator message appeared.

I can confirm that the outgoing email was never disabled on the instance where the backup was made.

I did tick the option to enable readonly mode when performing backup operations.

Is this a bug or did I mess up somewhere?

2 个赞

这条消息应该只会显示很短的时间。只要你在创建备份时没有禁用发件邮件,恢复完成后它就应该消失。如果提示没有自动消失,刷新浏览器页面应该会有帮助。


我将此标记为 Contribute > Bug,因为我们目前在恢复前禁用发件邮件的方式几乎毫无用处。恢复期间 Sidekiq 会被禁用,因此在此期间不会发生任何操作。而且,恢复操作会覆盖 disable_email 设置的值。修复这个 bug 需要在恢复后更改站点设置。

@eviltrout 你在 When restoring a backup, disable emails. · discourse/discourse@ccf9b70 · GitHub 中添加了这段代码。你怎么看?我们是应该修复这个 bug 还是移除这段代码?在我看来,在恢复后更改站点设置会让人感到意外,所以我赞成移除。此外,近 3 年来几乎没有人抱怨过这个问题…… :wink:

3 个赞

I think the idea was that when a restore finishes the administrator might want to poke around and make sure everything is OK. Right now emails will start going out the second it finishes and the site might not be “approved.”

4 个赞

So therefore this is not a bug @gerhard

Maybe Discourse should make it a bit more clear to the admin (e.g. entry inserted in the backup log panel). The site setting for disable_emails is set to no while the message renders and this is confusing (admin panel says disable emails is off while the message on the top of the screen still says its disabled)

Well, I consider it a bug when a line of code doesn’t do what it’s supposed to do. :wink: Anyway, it’s fixed: FIX: Outgoing emails were not disabled after restoring backup · discourse/discourse@dc961fe · GitHub

I made a small adjustment, because I think it’s better to disable outgoing emails only for non-staff users instead of all of them.

7 个赞

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.