How to see postfix mail queue

To see the postfix mail queue, 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.
  2. postqueue -p | less: This command shows the current mail queue and allows you to scroll through the output using the less pager.
  3. mailq: This command is a shortcut for postqueue -p and shows the current mail queue.
  4. postsuper -s: This command shows the current mail queue, including the sender, recipient, and status of each message, and also allows you to delete messages from the queue.

You can also use the postcat command to view the contents of a specific message in the queue. For example:

postcat -q <queue_id>

Replace <queue_id> with the ID of the message you want to view.

Note: The postqueue and postsuper commands are part of the Postfix package and are usually installed by default. If you don't have these commands available, you may need to install the Postfix package or check your system's documentation for alternative commands.

Also, you can use tail command to monitor the mail queue in real-time:

tail -f /var/spool/postfix/maildrop

This will show you the latest messages that are being processed by Postfix.

You can also use postfix status command to check the status of the mail queue:

postfix status

This will show you the current 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 have been delivered.