From owner-freebsd-bugs Sat Apr 13 14:50: 9 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 26CF937B405 for ; Sat, 13 Apr 2002 14:50:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g3DLo1t93505; Sat, 13 Apr 2002 14:50:01 -0700 (PDT) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id AC0C737B400 for ; Sat, 13 Apr 2002 14:43:23 -0700 (PDT) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g3DLhNk92878; Sat, 13 Apr 2002 14:43:23 -0700 (PDT) (envelope-from nobody) Message-Id: <200204132143.g3DLhNk92878@freefall.freebsd.org> Date: Sat, 13 Apr 2002 14:43:23 -0700 (PDT) From: Ralph Meijer To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: misc/37047: daily_status_mailq_shorten doesn't produce correct output Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 37047 >Category: misc >Synopsis: daily_status_mailq_shorten doesn't produce correct output >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Apr 13 14:50:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Ralph Meijer >Release: 4.3-RELEASE >Organization: >Environment: FreeBSD web3.olm.nl 4.3-RELEASE FreeBSD 4.3-RELEASE #1: Thu Jan 31 12:42:21 CET 2002 jorisb@web3.olm.nl:/usr/src/sys/compile/WEB3 i386 >Description: The script /etc/periodic/daily/440.status-mailq doesn't produce the correct output when the config variable $daily_status_mailq_shorten is set to "YES". The problem is that there is a second assignment to $rc so there is no output left to go through wc(1). >How-To-Repeat: add the line: daily_status_mailq_shorten="YES" to /etc/periodic.conf and run the script with a mailq filled with at least two destination addresses that are the same >Fix: This patch solves the problem: --- 440.status-mailq.orig Sat Apr 13 23:34:20 2002 +++ 440.status-mailq Sat Apr 13 23:21:02 2002 @@ -29,12 +29,12 @@ rc=$(case "$daily_status_mailq_shorten" in [Yy][Ee][Ss]) - rc=$(mailq | + mailq | perl -ne 'print if /^\s+\S+@/' | sort | uniq -c | sort -nr | - awk '$1 > 1 {print $1, $2}');; + awk '$1 > 1 {print $1, $2}';; *) mailq;; esac | tee /dev/stderr | fgrep -v 'mqueue is empty' | wc -l) >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message