View a summary of the Exim mail queue

In this article I’m going to go over how you can view a summary of the current Exim mail queue on your VPS (Virtual Private Server) or dedicated server. This will give you a quick glance of what domains have the most mailing activity currently going on.

If you’ve read one of my previous articles on either how to manage the Exim mail queue via SSH, or managing the Exim mail queue in WHM, then you should know how to view and manage the mail queue on your server. However in this article I’m going to talk about getting a full summary of your Exim mail queue so that you can get a quick rough idea of where the most email activity is being generated from on your server.

In order to follow along with the steps below you’ll need to have root access to either your VPS or dedicated server so that you have access to the Exim commands we’ll be running.

Viewing current Exim mail queue summary

Using the steps below I’ll show you how to view a summary of the messages currently in your Exim mail queue on your server.

  1. Login to your server via SSH as the root user.
  2. Run the following command to view the summary of the current Exim mail queue:
    exim -bp | exiqsumm | egrep -v "--|Volume|^$" | sort -bg | awk '{print "Volume: " $1 " t Domain: " $5}'
    Code breakdown:

    exim -bpRun the exim command with the -bp flag to show the current Exim mail queue.
    exiqsummUse the exiqsumm command to summarize the output from the Exim mail queue.
    egrep -v “–|Volume|^$” | sort -bgUse the egrep -v command to not display any lines that include text we have specified. In this case lines that have at least two dashes , the word Volume, or any lines that are blank identified by a carrot ^ which indicates the beginning of a line, and a dollar symbol $ indicating the end of a line.
    awk ‘{print “Volume: ” $1 ” t Domain: ” $5}’Use the awk command to print out the word Volume: followed by the $1st column which is the total number of messages in the queue. Then print Domain: followed by the $5th column of data which is the domain name.

    You should get back something that looks similar to this:

    Volume: 70 Domain: yahoo.com
    Volume: 227 Domain: gmail.com
    Volume: 461 Domain: example.com
    Volume: 1402 Domain: TOTAL

    So in this case we can see that in total we’ve got 1,402 messages in our Exim mail queue, 461 of those waiting to deliver for our example.com domain, and then 227 waiting to deliver to gmail.com accounts, and 70 to yahoo.com accounts.

You should now be able to login to your server at anytime to check on the current mail activity going on in your Exim mail queue.

InMotion Hosting Contributor
InMotion Hosting Contributor Content Writer

InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!

More Articles by InMotion Hosting

Was this article helpful? Join the conversation!