How to check mail queue status in linux

To check the mail queue status in Linux, you can use the following commands:

  1. postqueue -p: This command shows the current mail queue, including the sender, recipient, and status of each message.

    postqueue -p

    This will display a list of messages in the queue, along with their status (e.g. "hold", "active", "deferred", etc.).

  2. postqueue -s: This command shows the status of the mail queue, including the number of messages in the queue, the number of messages that are being processed, and the number of messages that are on hold.

    postqueue -s

    This will display a summary of the mail queue status, including the number of messages in each state.

  3. mailq: This command is similar to postqueue -p, but it also shows the size of each message in the queue.

    mailq

    This will display a list of messages in the queue, along with their size and status.

  4. sendmail -bp: This command shows the current mail queue, including the sender, recipient, and status of each message.

    sendmail -bp

    This will display a list of messages in the queue, along with their status.

  5. msmtp -q: If you are using the msmtp mail transfer agent, you can use the following command to check the mail queue status:

    msmtp -q

    This will display a list of messages in the queue, along with their status.

Note: The exact command to check the mail queue status may vary depending on the mail transfer agent (MTA) you are using. For example, if you are using Postfix, you can use postqueue -p or mailq. If you are using Sendmail, you can use sendmail -bp.