If mail is in the process of being sent (rather than sitting in
the queue) we probably shouldn't complain about it.  If something
like daily.local causes mail to be sent this can end up with a lot
of false positives.  (False in the sense that nothing is actually
wrong, so the system should be quite about it.)


Index: etc/daily
===================================================================
RCS file: /cvs/src/etc/daily,v
retrieving revision 1.84
diff -u -p -r1.84 daily
--- etc/daily   30 Dec 2015 22:59:53 -0000      1.84
+++ etc/daily   2 Jan 2016 06:25:55 -0000
@@ -138,11 +138,15 @@ else
 fi
 
 # The first two regular expressions handle sendmail, the third postfix.
+# The fourth is for smtpd(8), and tries to allow for the possibility that
+# something invoked from /etc/daily.local has just sent mail which is
+# now in the process of being sent (and would thus often be a false positive).
 # When the queue is empty, smtpd(8) and exim -bp keep silent.
 next_part "mail:"
 mailq | grep -v -e "^/var/spool/mqueue is empty$" \
                -e "^[[:blank:]]*Total requests: 0$" \
-               -e "^Mail queue is empty$"
+               -e "^Mail queue is empty$" \
+               -e "|inflight|0|$"
 
 next_part "network:"
 if [ "X$VERBOSESTATUS" != X0 ]; then

Reply via email to