Mail Queue Related:
postsuper: The Postsuper command is a postfix queue maintenance job. The use of this command is limited to superuser users.
By default, Postsuper performs the operations requested by using the-s and-P command-line options in all Postfix queue directories, including incoming, active, and deferred directories with mail files, as well as bounce, delay, trace, and refresh directories and log files.
postsuper Syntax format :
Postsuper [-PSSV] [-C Config_dir] [-D queue_id] [-H queue_id] [-H queue_id] [-R queue_id] [directory ...]
Reference Links:
Http://www.tutorialspoint.com/unix_commands/postsuper.htm
Http://www.postfix.org/postsuper.1.html
MAILQ Syntax : MAILQ [-Q]
MAILQ can list the list of messages to be sent, including the message ID, the size of the message, the time the message was saved, the sender, the recipient, and the reason why the message could not be sent, providing administrator reference information. MAILQ actually executes the SENDMAIL-BP directive. Parameter:-V displays more detailed information.
1. Query the mailing list:
Postqueue-p
Mailq
Postqueue-p |tail
Postqueue-p | Wc-l
2. Display message content: Postcat-q queue_id
2. Delete the queue:
MAILQ | awk "/x[email protected]/{print $}" | Tr-d "*" | Xargs-n 1 postsuper-d
MAILQ | Tail +2 | awk ' BEGIN {RS = ' "}/[email protected]\.org$/{print $} ' | tr-d ' *! ' | Postsuper-d
postsuper-d All hold/deffered ... Delete all messages in a queue
Postqueue-f (All)
Postqueue-s Host name (individual objects)
#!/bin/bashcd/tmp/usr/sbin/postqueue-p|egrep ' [email protected] ' |awk ' {print '} ' > Spam_queue.txtfor i in ' cat/tmp/ Spam_queue.txt ' do/usr/sbin/postsuper-d $idone
3. Other operations:
Postsuper-r queue_id
Postsuper-r All
Service Related:
Postfix start: Postfix start
Postfix stop: Postfix stop
Reload postfix configuration file:/usr/sbin/postfix
View MAILQ and Postsuper usage repair queue, etc.: postfix check
Postmap Check for syntax errors or make the file effective immediately.
There is a statement error in the Postmap mail.c file,
Postmap virtual is encrypted in effect
Postalias/etc/alias make the Mail alias file effective immediately
Log Related:
Mail log: Tail-f/var/log/maillog
System log: Tail-f/var/log/messages
CLAMD Related: tail-f/var/log/clamav/clamd.log tail-f/var/log/clamav/freshclam.log
Maildrop Related: Tail-f/var/log/maildrop.log
Eg.tail-f/var/log/maillog-n 10
Postfix and Extmail daily use of relevant notes information.
Linux-postfix&extmail Mail queue issues and daily maintenance