# 能否通过 cron 每天自动重启一次？

**URL:** <https://meta.discourse.org/t/auto-restarting-once-a-day-via-cron/400176>\
**Category:** Support\
**Tags:** email-in\
**Created:** [2026年四月8日 02:54 UTC](https://meta.discourse.org/t/auto-restarting-once-a-day-via-cron/400176 "2026-04-08T02:54:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kwest](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@kwest](https://meta.discourse.org/u/kwest)\
**Post date:** [2026年四月8日 02:54 UTC](https://meta.discourse.org/t/auto-restarting-once-a-day-via-cron/400176/1 "2026-04-08T02:54:08Z")

</div>

几周前我发布过以下内容：

> [@Discourse stopped polling my POP3 server](https://meta.discourse.org/t/discourse-stopped-polling-my-pop3-server/398324):
>
> Hello, I run a Discourse server at Digital Ocean which polls our incoming email address at a cPanel-based shared hosting provider to retrieve messages to post to Discourse. It’s generally worked very well for a couple of years, but stopped working yesterday - the mailbox received an email yesterday at 3:44 pm, and that DID get picked up by our DO Discourse instance, but three emails that came in shortly after that are not getting picked up. (The emails appear in the shared host’s cPanel Email p…

此后，我们遇到了一起事件：Discourse 连续五天未能接收 incoming 邮件。4 月 1 日，它及时抓取了两封 incoming 邮件，但随后未能抓取 4 月 2 日和 4 月 3 日收到的四封 incoming 邮件帖子。接着，4 月 5 日，日志显示（原因不明）：

| 任务异常：-ERR [SYS/TEMP] 服务器正在关闭。 |
| --- |

第二天，它又开始从我们的 POP 邮箱中检索邮件（尽管仍然偶尔出现延迟——设置为每隔几分钟检查一次邮箱，但有时几分钟内就能获取新消息，有时则需要几个小时）。

尝试每天通过 cron 任务重启一次 Discourse 是否有帮助？这是一个低流量社区，每天只有少量帖子（通常为 5-10 条），但大多数成员通过邮件接收帖子，每个人都希望邮件帖子能及时发出。

因此：

每天重启一次 Discourse 对应用是有益、有害，还是毫无影响？

还有什么其他方法可以让 Discourse 更频繁地抓取我们的 POP 消息吗？

谢谢！

---

<div class="post-metadata">

**Author:** ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)\
**Post date:** [2026年四月8日 03:04 UTC](https://meta.discourse.org/t/auto-restarting-once-a-day-via-cron/400176/2 "2026-04-08T03:04:51Z")

</div>

> [@kwest](#):
>
> 作业异常：-ERR [SYS/TEMP] 服务器正在关闭。

这不是 Discourse 的问题。这是来自您的 POP3 服务器的错误消息。您应该联系您的共享主机 cPanel 提供商来解决此问题。

更好的做法是设置直接投递入站邮件：[Configure direct-delivery incoming email for self-hosted sites with Mail-Receiver](https://meta.discourse.org/t/configure-direct-delivery-incoming-email-for-self-hosted-sites-with-mail-receiver/49487)

---

<div class="post-metadata">

**Author:** ![kwest](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@kwest](https://meta.discourse.org/u/kwest)\
**Post date:** [2026年四月8日 03:37 UTC](https://meta.discourse.org/t/auto-restarting-once-a-day-via-cron/400176/3 "2026-04-08T03:37:29Z")

</div>

你好，Richard，

感谢你的有用回复。

“服务器正在关闭”这条信息是来自我的 POP 服务器吗？我原本以为是来自 Digital Ocean 的 droplet。（我刚刚又查看了一下错误日志，果然，堆栈跟踪显示是 POP3Command#check\_response。真是奇怪。）

非常感谢你提供那个关于直接投递入站邮件的链接——我原本以为自己在做这件事，但看来并非如此。对于在需要将所有其他入站邮件转发到 cPanel 的情况下，还要正确配置入站和出站邮件的复杂性，我有点顾虑。不过这是一个很好的建议，也许我会尝试一下。

非常感谢你提供的这些有用信息！

---

<div class="post-metadata">

**Author:** ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)\
**Post date:** [2026年四月8日 03:40 UTC](https://meta.discourse.org/t/auto-restarting-once-a-day-via-cron/400176/4 "2026-04-08T03:40:24Z")

</div>

> [@kwest](#):
>
> “服务器正在关闭”的提示是来自我的 POP 服务器吗？

是的

> [@kwest](#):
>
> 关于在确保所有其他 incoming 邮件都指向 cPanel 的前提下，正确配置 incoming 和 outgoing 邮件的复杂性

我不完全确定您的具体配置，但最简单的做法是将 @example.com 指向您的 cPanel，而使用 @forum.example.com 作为论坛的邮箱地址。

---

<div class="post-metadata">

**Author:** ![LotusJeff](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lotusjeff/32/477888_2.png) [@LotusJeff](https://meta.discourse.org/u/LotusJeff)\
**Post date:** [2026年四月8日 13:56 UTC](https://meta.discourse.org/t/auto-restarting-once-a-day-via-cron/400176/5 "2026-04-08T13:56:52Z")

</div>

通常的做法是设置不同的子域，以便将邮件分离。Discourse 内部的邮件系统可以与托管它的域名完全不同的域名配合使用。例如，我将 Discourse 部署在 [forums.tld.com](http://forums.tld.com)，而邮件部署在 [mail.tld.com](http://mail.tld.com)。这样，[tld.com](http://tld.com) 的主邮件服务器就可以独立于 Discourse 的邮件管理而运行。

我们刚刚从 POP3 模式迁移到了邮件接收器模式。安装非常简单，而且运行效果要好得多。
