使用 systemd 重新启动 Postfix 而不断开连接

4 postfix systemd centos7

在 CentOS7 上,使用 systemd 或其他方式,有没有比以下更好的方法来重新启动 postfix:

sudo systemctl restart postfix
Run Code Online (Sandbox Code Playgroud)

上述操作不会破坏任何正在发生的活动邮件连接吗?我正在寻找类似 Apache 的优雅重启之类的东西,并想知道它是否可能,或者是否有必要。

Mic*_*ton 7

对 postfix 配置的更改很少需要完全重新启动。让 postfix 在运行时重新加载其配置几乎总是足够的。

systemctl reload postfix
Run Code Online (Sandbox Code Playgroud)

甚至手册页也提到了这一点。

              Note: in order to refresh the Postfix mail system after  a  con-
              figuration  change,  do  not  use the start and stop commands in
              succession. Use the reload command instead.
Run Code Online (Sandbox Code Playgroud)

即使邮件连接确实中断,当您必须重新启动邮件服务器时,发送邮件服务器也会稍后重试。