Skip to main content

Can't pipe exim queue length to email when run via cron

Comments

2 comments

  • cPanelMichael
    Hello, You may find the following thread helpful: Notification if Mail Queue Manager pass 100 emails Or, you might find it easier to use a third-party application such as: ConfigServer Mail Queues Thank you.
    0
  • twhiting9275
    While not a pipe, this will do the same thing, and won't spam the hell out of you. Configure it to notify you only if your mail queue is higher than a magic number!
    #!/bin/bash DATE=`date +%F` #DATE=date`%Y-%m-%d` SUBJ="$HOSTNAME email queue report" #your email address MYEMAIL="youremailhere" #change this to the magic # to alert you after emailtoomany=10 mailfile="/tmp/mailcheck.txt" mailtest="/tmp/mailtest.txt" qnum=$(exim -bpc) if [ $qnum -gt $emailtoomany] then rm -rf $mailfile echo "Mail queue problem Queue is $qnum" >> $mailfile mailx -s "$SUBJ" $MYEMAIL < $mailfile rm -rf $mailfile fi
    0

Please sign in to leave a comment.