There was a problem loading the comments.

Exim Mail queue monitoring Script

Support Portal  »  Knowledgebase  »  Viewing Article

Exim is a mail transfer agent mainly used in cPanel and DirectAdmin servers. Nowadays spamming is a common issue and an Exim Mail queue monitoring Script will help you to find these kinds of problems in the beginning itself.

First, you need to create a script file, say “”

  • vim

Read more about VI editor here.

Add the following script to the above file.

  • #!/bin/bash
  • NUM=`/usr/sbin/exim -bpc`
  • if [ $NUM -gt 100 ]
  • then echo "Current Email Queue size is $NUM" | /bin/mail -s "Email Queue Critical on $HOSTNAME" [email protected]
  • fi

Please replace [email protected] with the desired email address.

Give excecution permission

  • chmod +x

Run this script after certain period using cronjobs.

  • 0 * * * * /bin/sh /root/ >/dev/null 2>&1

This cronjob runs every hour.

Share via

Related Articles

Copyright © 2023 TheGigabit. All right reserved. Reg.No: 200701034297 (792326-P)