Postfix: Email queue management, most common management commands Print

  • 2

Here are the commands for managing e-mail queues with Postfix:

To check the status of the SMTP queue:

postqueue -p
This command displays the errors and the size of the queue

To clear the queue:

postsuper -d ALL
To delete deferred emails, i.e. those that are in Retry

postsuper -d ALL deferred
The default folder for email storage is:

/ var / spool / postfix
To process the queue:

postqueue -f
To clear queued emails from a specific domain:

postqueue -p | tail -n +2 | awk 'BEGIN {RS = ""} /username@example\.com/ {print $ 1}' | tr -d '*!' | postsuper -d -

where example is the domain in question and .com is the extension

Code Deferred Analysis:

qshape deferred | head
View queued messages by destination

qshape -s deferred | head Displays messages queued for sender
Displays last 100 lines of the mail.log

tail -n 100 /var/log/mail.log
View the mail.log queue in real time

tail -f /var/log/mail.log
Search for an address in mail.log

grep tom@domain.com /var/log/mail.log
Stop postfix

postfix stop
Start postfic

postfix start
View Postfix configuration

postconf -n
Postfix configuration file path

/etc/postfix/main.cf


Was this answer helpful?

« Back