Linux

Where Does Postfix Store Config and Queues?

Postfix keeps config in /etc/postfix, queues in /var/spool/postfix, and mail in /var/mail. Config, queue and log paths.

Last updated

Postfix splits its footprint three ways. Configuration lives in /etc/postfix, led by main.cf for settings and master.cf for services. Live mail queues live in /var/spool/postfix with one subfolder per queue state. Delivered system mail lands in /var/mail or Maildirs depending on setup.

The queue directories are daemon-owned state, not config: manage them with postqueue and postsuper, never an editor. postconf prints live settings and postconf -n prints only your deviations, which is the fastest way to audit a server you inherited. Logs go wherever syslog routes mail, usually maillog or mail.log. These paths have been stable for decades across distributions.

Where Postfix stores this, by platform

Linux
/etc/postfix/main.cf

main.cf holds settings, master.cf defines services; check with postfix check and dump deviations with postconf -n. Queues under /var/spool/postfix are managed with postqueue and postsuper, never edited by hand. Delivered mail lands in /var/mail or Maildirs per setup. Logs follow syslog mail routing.

Frequently asked questions

how do i see stuck postfix mail

Read the queue with postqueue -p and the logs (usually /var/log/maillog or mail.log) together. Deferred mail shows the SMTP reason inline; logs show the conversation. postcat opens individual queued files by ID. Never hand-edit files under /var/spool/postfix; use postqueue and postsuper to manage them.

how do i verify postfix config after upgrade

Run postfix check for permissions and basic sanity, then postconf -n to dump non-default settings for review. Most upgrade breakage is a main.cf option that changed meaning; the release notes flag them. Keep the previous main.cf and master.cf copies; diffing beats guessing.

can i delete sendmail files after postfix install

That is normal and safe to leave. The compatibility symlinks and sendmail binary let cron and scripts submit mail without knowing Postfix exists. Removing them breaks local delivery for system mail. The queue directories alongside are live state, not leftovers.

Notice an outdated path? Let us know.