From nobody@FreeBSD.org  Sat Apr 13 14:43:24 2002
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id AC0C737B400
	for <freebsd-gnats-submit@FreeBSD.org>; 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 <gnats-freebsd@ralphm.ik.nu>
To: freebsd-gnats-submit@FreeBSD.org
Subject: daily_status_mailq_shorten doesn't produce correct output
X-Send-Pr-Version: www-1.0

>Number:         37047
>Category:       conf
>Synopsis:       daily_status_mailq_shorten doesn't produce correct output
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    brian
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 13 14:50:01 PDT 2002
>Closed-Date:    Wed Jan 12 02:40:26 GMT 2005
>Last-Modified:  Wed Jan 12 02:40:26 GMT 2005
>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:
Responsible-Changed-From-To: freebsd-bugs->brian 
Responsible-Changed-By: johan 
Responsible-Changed-When: Tue Apr 23 17:48:17 PDT 2002 
Responsible-Changed-Why:  
Over to Brian,whi introduced this in rev 1.6 of 
etc/periodic/daily/440.status-mailq 


http://www.freebsd.org/cgi/query-pr.cgi?pr=37047 
State-Changed-From-To: open->closed 
State-Changed-By: brian 
State-Changed-When: Wed Jan 12 02:39:46 GMT 2005 
State-Changed-Why:  
This is (was!) a duplicate of 23766 which was fixed in May 2002. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37047 
>Unformatted:
