Date: Fri, 9 May 2008 13:52:16 +0200 (CEST) From: Frank Behrens <frank+bsdpr@harz.behrens.de> To: FreeBSD-gnats-submit@FreeBSD.org Subject: conf/123551: [patch] /etc/periodic/daily/440.status-mailq should also print quarantined and lost queue entries Message-ID: <200805091152.m49BqGlr042743@moon.behrens> Resent-Message-ID: <200805091210.m49CA1ss048682@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 123551 >Category: conf >Synopsis: [patch] /etc/periodic/daily/440.status-mailq should also print quarantined and lost queue entries >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri May 09 12:10:00 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Frank Behrens >Release: FreeBSD 7.0-BETA4-200712071613 i386 >Organization: >Environment: >Description: The sendmail default mail queue can contain the following message types: normal mails, quarantined mails and lost mails - see mailq(1). The periodic status scripts prints only the 1st message type (normal messages). To keep informed about quarantined and lost messages the other message entries should be printed, too. The attached patch implemements the output for quaratined and lost messages in a similar manner as it was done for the client submission queue. >How-To-Repeat: Quarantine a message in sendmail, e.g. via a milter program. The default periodic script does not inform about such message. >Fix: --- periodic_mailq_quarantine.patch begins here --- --- etc/periodic/daily/440.status-mailq.orig 2007-12-08 18:09:45.000000000 +0100 +++ etc/periodic/daily/440.status-mailq 2008-05-09 13:25:38.000000000 +0200 @@ -58,6 +58,46 @@ [ $rc_submit -gt 0 ] && rc=1 fi;; esac + + case "$daily_status_include_quarantine_mailq" in + [Yy][Ee][Ss]) + echo "" + echo "Mail in quarantine queue:" + + rc_submit=$(case "$daily_status_mailq_shorten" in + [Yy][Ee][Ss]) + mailq -qQ | + egrep -e '^[[:space:]]+[^[:space:]]+@' | + sort | + uniq -c | + sort -nr | + awk '$1 >= 1 {print $1, $2}';; + *) + mailq -qQ;; + esac | tee /dev/stderr | + egrep -v '(mqueue is empty|Total requests)' | wc -l) + [ $rc_submit -gt 0 ] && rc=1 + esac + + case "$daily_status_include_lost_mailq" in + [Yy][Ee][Ss]) + echo "" + echo "Mail in lost queue:" + + rc_submit=$(case "$daily_status_mailq_shorten" in + [Yy][Ee][Ss]) + mailq -qL | + egrep -e '^[[:space:]]+[^[:space:]]+@' | + sort | + uniq -c | + sort -nr | + awk '$1 >= 1 {print $1, $2}';; + *) + mailq -qL;; + esac | tee /dev/stderr | + egrep -v '(mqueue is empty|Total requests)' | wc -l) + [ $rc_submit -gt 0 ] && rc=1 + esac fi;; *) rc=0;; --- etc/defaults/periodic.conf.orig 2007-12-08 18:09:00.000000000 +0100 +++ etc/defaults/periodic.conf 2008-05-09 13:21:01.000000000 +0200 @@ -119,6 +119,8 @@ daily_status_mailq_enable="YES" # Check mail status daily_status_mailq_shorten="NO" # Shorten output daily_status_include_submit_mailq="YES" # Also submit queue +daily_status_include_quarantine_mailq="YES" # Also quarantine queue +daily_status_include_lost_mailq="YES" # Also lost queue # 450.status-security daily_status_security_enable="YES" # Security check --- periodic_mailq_quarantine.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805091152.m49BqGlr042743>