When you run exim mail server, it is good to keep an eye on number of emails in mail queue. here is a PHP script that will check number of emails in queue, if it exceed pre-set number, it will email you.
Add following content.
$cmd = '/usr/sbin/exim -bpc';
$num_mails = exec($cmd);
$alertOn = 100;
if ($num_mails > $alertOn)
$hostname = exec('/bin/hostname');
$subject = 'Mail queue alert on ' . $hostname;
$mail_text = 'Mail queue on server ' . $hostname . ' have ' . $num_mails . ' mails';
mail($adminEmail, $subject, $mail_text);
In this case, if mails in queue exceeded 100, you get email.
You can change 100 to whatever number you need.
Replace [email protected] with your email address.
Set script to run every 10 minutes using cronjob
*/10 * * * * /usr/local/bin/php /usr/serverok/mail_q_monitor.php >/dev/null 2>&1