3 # $FreeBSD: src/etc/periodic/daily/440.status-mailq,v 1.11 2006/03/08 17:26:53 matteo Exp $
4 # $DragonFly: src/etc/periodic/daily/440.status-mailq,v 1.4 2007/12/29 21:44:44 matthias Exp $
7 # If there is a global system configuration file, suck it in.
9 if [ -r /etc/defaults/periodic.conf ]
11 . /etc/defaults/periodic.conf
15 case "$daily_status_mailq_enable" in
17 if [ ! -x /usr/bin/mailq ]
19 echo '$daily_status_mailq_enable is set but /usr/bin/mailq' \
24 echo "Mail in local queue:"
26 rc=$(case "$daily_status_mailq_shorten" in
29 egrep -e '^[[:space:]]+[^[:space:]]+@' |
33 awk '$1 >= 1 {print $1, $2}';;
36 esac | tee /dev/stderr |
37 egrep -v '(mqueue is empty|Total requests)' | wc -l)
38 [ $rc -gt 0 ] && rc=1 || rc=0
40 case "$daily_status_include_submit_mailq" in
42 if [ -f /etc/mail/submit.cf ]
45 echo "Mail in submit queue:"
47 rc_submit=$(case "$daily_status_mailq_shorten" in
50 egrep -e '^[[:space:]]+[^[:space:]]+@' |
54 awk '$1 >= 1 {print $1, $2}';;
57 esac | tee /dev/stderr |
58 egrep -v '(mqueue is empty|Total requests)' | wc -l)
59 [ $rc_submit -gt 0 ] && rc=1