Linux-postfix&extmail Mail queue issues and daily maintenance

Source: Internet
Author: User
Tags message queue system log

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:

    • Delete all messages in the queue: postsuper-d all deferred

    • Delete an ID message: postsuper-d queue_id

    • Empty a user's mailbox queue for all messages

MAILQ | awk "/x[email protected]/{print $}" | Tr-d "*" | Xargs-n 1 postsuper-d

    • Delete all ( This action removes all queue information, think twice ): postsuper-d All

    • Delete Message Queue

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)

    • Clears the message queue for a single user Postquene

#!/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:

    • Withholding Mail: postsuper-h queue_id

    • Reply to a message: Postsuper-h queue_id

    • Re-schedule:

Postsuper-r queue_id

Postsuper-r All

    • Immediately deliver all messages in the queue (with caution): Postfix flush

    • View Queue mail: postqueue-p

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

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.