Postfix /etc/systemd/postfix.service

原始 📋 Red Hat Enterprise Linux 9 (Plow) 22 行

详情

大小
22 行
MD5
e4965ef7ea7440b0ab58518c126d30d0
SHA256
2d8f604c65075efecd40a81d7a9e7f8fcd9c2e5b6d335561a033ca7b6335495c
/etc/systemd/postfix.service
[Unit]
Description=Postfix Mail Transport Agent
After=syslog.target network.target
Conflicts=sendmail.service exim.service

[Service]
Type=forking
PIDFile=/var/spool/postfix/pid/master.pid
EnvironmentFile=-/etc/sysconfig/network
PrivateTmp=true
CapabilityBoundingSet=~ CAP_NET_ADMIN CAP_SYS_ADMIN CAP_SYS_BOOT CAP_SYS_MODULE
ProtectSystem=true
PrivateDevices=true
ExecStartPre=-/usr/sbin/restorecon -R /var/spool/postfix/pid
ExecStartPre=-/usr/libexec/postfix/aliasesdb
ExecStartPre=-/usr/libexec/postfix/chroot-update
ExecStart=/usr/sbin/postfix start
ExecReload=/usr/sbin/postfix reload
ExecStop=/usr/sbin/postfix stop

[Install]
WantedBy=multi-user.target

复制粘贴

curl:
curl https://exampleconfig.com/api/v1/config/original/e4965ef7ea7440b0ab58518c126d30d0?hint=postfix.service
wget:
wget -O postfix.service https://exampleconfig.com/api/v1/config/original/e4965ef7ea7440b0ab58518c126d30d0?hint=postfix.service

给 AI Agent 用

<prompt><role>DevOps agent</role><source url='https://exampleconfig.com/api/v1/config/original/e4965ef7ea7440b0ab58518c126d30d0?hint=postfix.service' /><config><app>Postfix</app><os>Red Hat Enterprise Linux 9 (Plow)</os><location>/etc/systemd/postfix.service</location><lines>22</lines><md5>e4965ef7ea7440b0ab58518c126d30d0</md5><sha256>2d8f604c65075efecd40a81d7a9e7f8fcd9c2e5b6d335561a033ca7b6335495c</sha256></config></prompt>

粘贴到 Claude、ChatGPT 或任何 AI 助手里。

安装 Postfix

Alpine Linux

sudo apk add postfix

Debian

sudo apt update && sudo apt install postfix

Red Hat Enterprise Linux

sudo yum install postfix

Ubuntu

sudo apt update && sudo apt install postfix

文件位置

文件路径
/etc/systemd/postfix.service
目录
/etc/systemd/
用途
系统级配置目录
说明
/etc/ 里的文件是系统级配置,影响所有用户。

FAQ

什么时候该用这个 postfix.service?

用来恢复缺失的默认文件、确认发行版本带了什么,或拿你的 Postfix config 做 diff。

怎么恢复 Postfix 的默认配置?

下载文件,把 /etc/systemd/postfix.service 里的当前配置备份好,替换掉,然后 reload 或 restart Postfix。

postfix.service 适合直接上生产吗?

这是 Red Hat Enterprise Linux 9 (Plow) 的厂商默认配置,只能当基线。上生产前请检查安全和性能设置。

和其他 OS 版本有什么不同?

默认值会随发行版和版本变化,这份对应 Red Hat Enterprise Linux 9 (Plow)。

我可以用它来排查 Postfix 吗?

可以。和你的配置做 diff 找出漂移,然后只恢复需要的段落。