About
How to manage the postfix queues
- maildrop
- hold
- incoming
- active
- deferred
- corrupt
Management
The management is done with this tools:
Number of emails
postqueue -p | grep -c "^[A-Z0-9]"
Resend
- The queue
postqueue -f
- One email
postqueue -i “Queue ID”
postqueue -I EmailID
Remove
- All
postsuper -d ALL
- One email
postsuper -d EmailID
postsuper -d “Queue ID”
- Based on a content pattern with grep
$PATTERN="Header: bad"
for id in `postqueue -p | grep '^[A-Z0-9]' | cut -f1 -d' ' | sed 's/*//g'`; do
postcat -q $id | grep $PATTERN && postsuper -d $id;
done
List
postqueue -p
See
You need first to list in order to retrieve the email id.
postcat -q EmailID
Move between queue
- Move the email from the incoming queue to the hold queue
postsuper -h ALL
- Move the email from the hold queue to the incoming queue
postsuper -r ALL