1. Mailq
Function Description: displays the list of emails to be sent.
Syntax: mailq [-q]
Note: mailq can list the emails to be sent, including the email ID, email size, email retention time, sender, recipient, and the reason why the emails cannot be sent, provide the Administrator's reference information. Mailq actually executes the sendmail-bp command.
Parameters:
-V displays more detailed information.
2. process the mail queue:
Stop postfix
#/Etc/init. d/postfix stop
For example, if you want to delete one or more emails, you can do the following:
The following is the result of mailq:
10EB53A808C 26985 Fri Dec 29 10:49:26 sane@aaa.com
(Lost connection with mx2.hotmail.com [65.54.244.168] while sending end of data -- message may be sent more than once)
Christina8163_8@hotmail.com
7B94A3A810F 3683 Sun Dec 24 19:20:11 MAILER-DAEMON
(Connect to mx-dfw-rpfn.emailscience.com [207.235.126.39]: Connection timed out)
Online@Webspan.net
We can use
Postsuper-d 7B94A3A810F
Delete all:
Postsuper-d ALL allIt must be uppercase or lowercase.
Operation commands for mail queue in Postfix
PostfixThe queue is placed in/Var/spool/deferredUnder,
QueuemgrCommand to delete the specifiedIDNumber of queues.
Postqueue-pView queue content
Postqueue-fResend the email from the storage queue once.
PostcatView the mail content in the queue
Postsuper-d ALL hold/deffered...Delete all emails in a queue
Postmap can check for syntax errors, or the file takes effect immediately.
A statement error is reported in the Postmap mail. c file.
Postmap virtual is encrypted to take effect
Postalias/etc/alias enables the email alias file to take effect immediately