Around a year ago I had written up this cute little Perl script that displays details about current Exim mail queue status on a Cpanel server. It not only displays the details but also allow you to make changes to the exim queue. Here’s how the script looks like when executed:

root@server1 [~]# ./exim_queue_report.pl

                   EXIM MAIL QUEUE REPORT
============================================================

-> Total mails in Queue: 20
-> No of frozen emails : 0

-> Emails per CPanel User:

 COUNT   USER
----------------------------------
    1   comput1
    2   linuxfl
    5   mailnull
   12   semid05

-> Mails to following email addresses got bounced:

 COUNT   EMAIL
----------------------------------
    5   althafpure@gmail.com

-> Subject of emails in the mail queue:

 COUNT   SUBJECT
----------------------------------
    1   Computer Seminar topics
    5   Mail delivery failed: returning message to sender
   12   Seminar topics
    1   [xxx.org] Please moderate: " HAL automounting failure :: How i rectified it ... !! "
    1   [xxx.org] Please moderate: "compiling a kernel(For the newbies)"

-> Scripts that sent mail (X-PHP-Script header):

 COUNT   SCRIPT
----------------------------------
    2   xxx.org/wp-comments-post.php
    1   www.computerseminar.net/sendemail.php
   12   www.seminar.net/sendemail.php

-> From address of mails in the mail queue:

 COUNT   FROM
----------------------------------
    5   Mailer-Daemon@server1.example.com
   12   email@gmail.com
    1   jukefopinpt@gmail.com
    2   wordpress@xxx.org

============================================================

-> What do you want to do?

 [1] Remove all mails of a Cpanel user
 [2] Remove all mails with specific subject
 [3] Remove all mails originated from a script source
 [4] Remove all bounced emails
 [5] Remove all frozen emails
 [6] Remove all mails From: specific email address
 [7] Chmod a script source to 000
 [8] I'm done! Exit...

Your choice ( 1 to 8 ) ->

You can download the script from http://www.technomenace.com/exim_queue_report.pl.gz