Postfix 删除队列中的邮件
#manpostsuperNAME
postsuper - Postfix superintendent
SYNOPSIS
postsuper [-psv] [-c config_dir] [-d queue_id]
[-h queue_id] [-H queue_id]
[-r queue_id]
-d queue_id
Deleteonemessagewiththe named queue ID from the named mail queue(s) (default: hold, incoming, active and
deferred).
If a queue_id of - is specified, the program reads queue IDs from standard input. Forexample,todeleteall
mail with exactly one recipient user@example.com:
mailq | tail +2 | grep -v ’^ *(’ | awk′BEGIN { RS = "" }
# $7=sender, $8=recipient1, $9=recipient2
{ if ($8 == "user@example.com" && $9 == "")
print $1 }
′ | tr -d ’*!’ | postsuper -d -
Specify"-dALL"toremoveallmessages;for example, specify "-d ALL deferred" to delete all mail in the
deferred queue.As a safety measure, the word ALL must be specified in upper case.
Warning: Postfix queue IDs are reused.There is a very small possibility that postsuper deletes the wrongmes-
sage file when it is executed while the Postfix mail system is delivering mail.
The scenario is as follows:
1) ThePostfixqueuemanager deletes the message that postsuper(1) is asked to delete, because Postfix is
finished with the message (it is delivered, or it is returned to the sender).
2) New mail arrives, and the new message is given the same queue ID as the message that postsuper(1) is sup-
posedto delete.The probability for reusing a deleted queue ID is about 1 in 2**15 (the number of dif-
ferent microsecond values that the system clock can distinguish within a second).
3) postsuper(1) deletes the new message, instead of the old message that it should have deleted.
页:
[1]