Postfix /etc/systemd/postfix@.service

Original 📋 Debian 9 (Stretch) 19 lines

Works On

Viewing:
Debian 9 (Stretch)
Same on:
Debian 10 (Buster) Debian 11 (Bullseye) Debian 12 (Bookworm) Ubuntu 18.04 LTS (Bionic Beaver) Ubuntu 20.04 LTS (Focal Fossa) Ubuntu 22.04 LTS (Jammy Jellyfish) Ubuntu 24.04 LTS (Noble Numbat)
Other versions:

Details

Size
19 lines
MD5
4224e053e1fa1cb321f51b18026bb698
SHA256
01730141e4cda8aa4240438c09e52746e5c61672a854f683469659be7ae9f7b5
/etc/systemd/postfix@.service
[Unit]
Description=Postfix Mail Transport Agent (instance %i)
Documentation=man:postfix(1)
PartOf=postfix.service
Before=postfix.service
ReloadPropagatedFrom=postfix.service
After=network-online.target nss-lookup.target
Wants=network-online.target

[Service]
Type=forking
GuessMainPID=no
ExecStartPre=/usr/lib/postfix/configure-instance.sh %i
ExecStart=/usr/sbin/postmulti -i %i -p start
ExecStop=/usr/sbin/postmulti -i %i -p stop
ExecReload=/usr/sbin/postmulti -i %i -p reload

[Install]
WantedBy=multi-user.target

Copy & Paste

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

For AI Agents

<prompt><role>DevOps agent</role><source url='https://exampleconfig.com/api/v1/config/original/4224e053e1fa1cb321f51b18026bb698?hint=postfix@.service' /><config><app>Postfix</app><os>Debian 9 (Stretch)</os><location>/etc/systemd/postfix@.service</location><lines>19</lines><md5>4224e053e1fa1cb321f51b18026bb698</md5><sha256>01730141e4cda8aa4240438c09e52746e5c61672a854f683469659be7ae9f7b5</sha256></config></prompt>

Paste into Claude, ChatGPT, or any AI assistant.

Install 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

File Location

File Path
/etc/systemd/postfix@.service
Directory
/etc/systemd/
Significance
System-wide configuration directory
Description
Files in /etc/ contain system-wide configuration settings that affect all users.

FAQ

When should I use this postfix@.service?

Use it to restore a missing default, confirm what shipped, or diff against your current Postfix config.

How do I restore Postfix defaults?

Download the file, back up the current one in /etc/systemd/postfix@.service, replace it, then reload or restart Postfix.

Is postfix@.service safe for production?

It is the vendor default for Debian 9 (Stretch). Treat it as a baseline and review security and performance settings before production use.

How does this differ from other OS versions?

Defaults vary by distro and version. This copy matches Debian 9 (Stretch).

Can I use this for Postfix troubleshooting?

Yes. Diff it against yours to find drift, then restore only the sections you need.