Update mail queue related periodic scripts to account for sendmail 8.12's
clientmqueue (submit mail queue). The new mailq display is only active if both the old daily_status_mailq_enable is set to "YES" and the new daily_status_include_submit_mailq is set to "YES" so people who disabled 440.status-mailq won't have any surprises. Likewise, the new queue run is only active if both the old daily_queuerun_enable is set to "YES" and the new daily_submit_queuerun is set to "YES" so people who disabled 500.queuerun won't have any surprises. While I am here, remove the [ ! -d /var/spool/mqueue ] checks from both scripts as the queue directory isn't always /var/spool/mqueue for the main daemon -- it can be set to anything in the sendmail.cf file. MFC after: 1 week
This commit is contained in:
parent
f4c5dfbb9a
commit
14a349d554
@ -102,6 +102,7 @@ daily_status_rwho_enable="YES" # Check system status
|
||||
# 440.status-mailq
|
||||
daily_status_mailq_enable="YES" # Check mail status
|
||||
daily_status_mailq_shorten="NO" # Shorten output
|
||||
daily_status_include_submit_mailq="YES" # Also submit queue
|
||||
|
||||
# 450.status-security
|
||||
daily_status_security_enable="YES" # Security check
|
||||
@ -117,6 +118,7 @@ daily_status_named_usedns="YES" # DNS lookups are ok
|
||||
|
||||
# 500.queuerun
|
||||
daily_queuerun_enable="YES" # Run mail queue
|
||||
daily_submit_queuerun="YES" # Also submit queue
|
||||
|
||||
# 999.local
|
||||
daily_local="/etc/daily.local" # Local scripts
|
||||
|
@ -18,11 +18,6 @@ case "$daily_status_mailq_enable" in
|
||||
echo '$daily_status_mailq_enable is set but /usr/bin/mailq' \
|
||||
"isn't executable"
|
||||
rc=2
|
||||
elif [ ! -d /var/spool/mqueue ]
|
||||
then
|
||||
echo '$daily_status_mailq_enable is set but /var/spool/mqueue' \
|
||||
"doesn't exist"
|
||||
rc=2
|
||||
else
|
||||
echo ""
|
||||
echo "Mail in local queue:"
|
||||
@ -39,8 +34,30 @@ case "$daily_status_mailq_enable" in
|
||||
mailq;;
|
||||
esac | tee /dev/stderr | fgrep -v 'mqueue is empty' | wc -l)
|
||||
[ $rc -gt 1 ] && rc=1
|
||||
fi;;
|
||||
|
||||
case "$daily_status_include_submit_mailq" in
|
||||
[Yy][Ee][Ss])
|
||||
if [ -f /etc/mail/submit.cf ]
|
||||
then
|
||||
echo ""
|
||||
echo "Mail in submit queue:"
|
||||
|
||||
rc=$(case "$daily_status_mailq_shorten" in
|
||||
[Yy][Ee][Ss])
|
||||
rc=$(mailq -Ac |
|
||||
perl -ne 'print if /^\s+\S+@/' |
|
||||
sort |
|
||||
uniq -c |
|
||||
sort -nr |
|
||||
awk '$1 > 1 {print $1, $2}');;
|
||||
*)
|
||||
mailq -Ac;;
|
||||
esac | tee /dev/stderr | fgrep -v 'mqueue is empty' | wc -l)
|
||||
[ $rc -gt 1 ] && rc=1
|
||||
fi;;
|
||||
esac
|
||||
fi;;
|
||||
|
||||
*) rc=0;;
|
||||
esac
|
||||
|
||||
|
@ -18,13 +18,15 @@ case "$daily_queuerun_enable" in
|
||||
echo '$daily_queuerun_enable is set but /usr/sbin/sendmail' \
|
||||
"isn't executable"
|
||||
rc=2
|
||||
elif [ ! -d /var/spool/mqueue ]
|
||||
then
|
||||
echo '$daily_queuerun_enable is set but /var/spool/mqueue' \
|
||||
"doesn't exist"
|
||||
rc=2
|
||||
else
|
||||
/usr/sbin/sendmail -q >/dev/null 2>&1 &
|
||||
case "$daily_submit_queuerun" in
|
||||
[Yy][Ee][Ss])
|
||||
if [ -f /etc/mail/submit.cf ]
|
||||
then
|
||||
/usr/sbin/sendmail -q -Ac >/dev/null 2>&1 &
|
||||
fi;;
|
||||
esac
|
||||
rc=0
|
||||
fi;;
|
||||
|
||||
|
@ -397,6 +397,16 @@ output when
|
||||
.Va daily_status_mailq_enable
|
||||
is set to
|
||||
.Dq YES .
|
||||
.It Va daily_status_include_submit_mailq
|
||||
.Pq Vt bool
|
||||
Set to
|
||||
.Dq YES
|
||||
if you also want to run
|
||||
.Xr mailq 1
|
||||
on the submit mail queue when
|
||||
.Va daily_status_mailq_enable
|
||||
is set to
|
||||
.Dq YES .
|
||||
.It Va daily_status_security_enable
|
||||
.Pq Vt bool
|
||||
Set to
|
||||
@ -541,6 +551,15 @@ if you want to enable reverse DNS lookups.
|
||||
Set to
|
||||
.Dq YES
|
||||
if you want to manually run the mail queue at least once a day.
|
||||
.It Va daily_submit_queuerun
|
||||
.Pq Vt bool
|
||||
Set to
|
||||
.Dq YES
|
||||
if you also want to manually run the submit mail queue at least once a day
|
||||
when
|
||||
.Va daily_queuerun_enable
|
||||
is set to
|
||||
.Dq YES .
|
||||
.It Va daily_local
|
||||
.Pq Vt str
|
||||
Set to a list of extra scripts that should be run after all other
|
||||
|
Loading…
Reference in New Issue
Block a user