How do I check the postfix queue size?

Better Stack Team
Updated on December 21, 2023

You can check the size and status of the Postfix mail queue using the postqueue command. To view the size of the queue, follow these steps:

  1. Open a terminal or SSH session to your server.
  2. Use the postqueue command with the p option to display the current mail queue status, including the number of messages and their total size:

     
    postqueue -p
    

    This will display a list of queued messages along with their queue IDs, size, arrival time, sender, and recipient information.

    Here's an example output:

     
    -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
    BBFBE12345      1024 Mon, 01 Jan 2023 10:00:00 +0000 sender@example.com
                                             recipient1@example.com
    
    CDEFG67890      2048 Tue, 02 Jan 2023 15:30:00 +0000 sender2@example.com
                                             recipient2@example.com
    

    In the example above, you can see two messages in the queue, each with their respective Queue ID, size (in bytes), arrival time, sender, and recipient information.

    If you only want to display the number of messages in the queue without the detailed listing, you can use the postqueue command with the -c option:

     
    postqueue -c
    

    This will simply output the number of messages in the queue, like this:

     
    2
    

    This indicates that there are two messages currently in the queue.

    Monitoring the Postfix mail queue can help you keep track of email delivery on your mail server and diagnose any issues related to email processing.

Got an article suggestion? Let us know
Explore more
Licensed under CC-BY-NC-SA

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Make your mark

Join the writer's program

Are you a developer and love writing and sharing your knowledge with the world? Join our guest writing program and get paid for writing amazing technical guides. We'll get them to the right readers that will appreciate them.

Write for us
Writer of the month
Marin Bezhanov
Marin is a software engineer and architect with a broad range of experience working...
Build on top of Better Stack

Write a script, app or project on top of Better Stack and share it with the world. Make a public repository and share it with us at our email.

community@betterstack.com

or submit a pull request and help us build better products for everyone.

See the full list of amazing projects on github