Postfix and Dovecot Cheat Sheet for RHEL, AlmaLinux and Rocky Linux
October 21, 2026 · by Zwiegnet Consulting · Linux, Network
A one-page reference for the Postfix and Dovecot commands you actually use when running mail on Red Hat Enterprise Linux, AlmaLinux, Rocky Linux, Oracle Linux and CentOS Stream. Everything here works with the AppStream packages on EL9 (Postfix 3.5, Dovecot 2.3.16) and EL10 (Postfix 3.8, Dovecot 2.3.21). For a full server build, see Configure Postfix and Dovecot on RHEL, AlmaLinux, Rocky and Oracle Linux.
Most commands need root. Replace QUEUE_ID, alice and example.com with your own values.
Install and service control
Command
What it does
dnf install postfix dovecot
Install from AppStream (add postfix-lmdb on EL9)
dnf install postfix-perl-scripts
Adds qshape and pflogsumm
systemctl enable --now postfix dovecot
Start now and at boot
systemctl reload postfix
Re-read main.cf/master.cf without dropping connections
postfix check
Check configuration and file permissions
postfix status
Show whether the Postfix master is running
postfix flush
Attempt delivery of all deferred mail now
alternatives --display mta
Confirm Postfix owns /usr/sbin/sendmail
postconf: read and change configuration
Command
What it does
postconf -n
Show only settings changed from defaults (start here)
postconf myhostname
Show the current value of one parameter
postconf -d myhostname
Show the built-in default for a parameter
postconf -e 'relayhost = [smtp.example.com]:587'
Set a parameter in main.cf
postconf -X relayhost
Remove a parameter from main.cf (back to default)
postconf -M
List services defined in master.cf
postconf -P
List per-service -o overrides in master.cf
postconf -m
List supported lookup table types (lmdb, cdb, hash…)
postconf -a
List SASL server plugins (should include dovecot)
postconf mail_version
Show the running Postfix version
Mail queue
Command
What it does
postqueue -p
List the queue (same as mailq)
postqueue -p | tail -n 1
One-line summary: total size and number of requests
postqueue -j
Queue listing as JSON, one message per line
postqueue -f
Flush: retry all deferred mail
postqueue -i QUEUE_ID
Retry one message now
postcat -q QUEUE_ID
Show a queued message (envelope, headers, body)
postcat -hq QUEUE_ID
Show only the headers of a queued message
postsuper -d QUEUE_ID
Delete one message
postsuper -d ALL deferred
Delete every deferred message
postsuper -d ALL
Delete the entire queue (careful)
postsuper -h QUEUE_ID
Put a message on hold
postsuper -H QUEUE_ID
Release a held message
postsuper -r ALL
Requeue everything (after fixing transport or relay settings)
qshape deferred
Deferred mail grouped by destination domain and age
Delete all queued mail from one sender (useful after a compromised account):