HostOnNet Blog

Tag Archives: mail queue

Deleting all mail from postfix mail queue

To delete all mail from Postfix Mail server queue, run Example root@vm701:~# postsuper -d ALL postsuper: Deleted: 77 messages root@vm701:~# Back to Postfix


PHP Script to alert if mail queue size is above X on Cpanel Server

I created a php script to alert if mail queue size if above 100. <?php $cmd =  ‘/usr/sbin/exim -bpc’; $num_mails = exec($cmd); if ($num_mails > 100) { $hostname = exec(‘/bin/hostname’); $subject = ‘Mail queue alert on ‘ . $hostname; $mail_text