Zimbra mailq notification email [Script-2]
Step: 01
Login as root and create below mentioned script:
vi /root/mailq.sh
Step: 02
#chmod +x /root/mailq.sh
Step: 03
#crontab -e
*/15 * * * * /root/mailq.sh
Login as root and create below mentioned script:
vi /root/mailq.sh
#!/bin/sh
mailq_count="$(/opt/zimbra/common/sbin/mailq | /usr/bin/tail -n1 | /usr/bin/gawk '{print $5}')"
FROM=adminx@texgroupltd.com
TO=shariful.islam@bol-online.com
if [ -z "$mailq_count" ]; then
mailq_count=0
fi
/opt/zimbra/common/sbin/sendmail -i $FROM $TO <<MAIL_END
Subject: Mail queue count on mail.texgroupltd.com
FROM: $FROM
To: $TO
Mail queue count on mail.texgroupltd.com is ${mailq_count}
MAIL_END
#chmod +x /root/mailq.sh
Step: 03
#crontab -e
*/15 * * * * /root/mailq.sh
Comments
Post a Comment