Postfix deletes messages in the queue

Source: Internet
Author: User
Tags all mail

# Man postsuper

Name

Postsuper-Postfix superintendent

Synopsis

Postsuper [-PSV] [-C config_dir] [-D queue_id]

[-H queue_id] [-H queue_id]

[-R queue_id] [directory...]

-D queue_id

Delete one message with the 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. For example, to delete all

Mail with exactly one recipient [email protected]:


Mailq | tail + 2 | grep-V '^ * (' | awk' begin {rs = ""}

#$7 = sender, $8 = recipient1, $9 = recipient2

{If ($8 = "[email protected]" & $9 = "")

Print $1}

'| Tr-d '*! '| Postsuper-d-


Specify "-d all" to remove all messages; for example, specify "-d all deferred" to delete all mail in

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 wrong mes-

Sage file when it is executed while the Postfix mail system is delivering mail.


The scenario is as follows:


1) the Postfix Queue Manager 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-

Posed to 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 shoshould have deleted.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.