From 1fa8485365659b59c7480ea62ea8d73c9e90fb5b Mon Sep 17 00:00:00 2001
From: Mark Sapiro <mark@msapiro.net>
Date: Fri, 31 Jul 2009 12:59:38 -0700
Subject: Updated contrib/mmdsr to report preserved messages.

---
 NEWS          |  6 ++++++
 contrib/mmdsr | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)

diff --git a/NEWS b/NEWS
index 41de8e8f..96c30bf5 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,12 @@ Copyright (C) 1998-2008 by the Free Software Foundation, Inc.
 
 Here is a history of user visible changes to Mailman.
 
+2.1.13 (xx-xxx-xxxx)
+
+  Bug Fixes and other patches
+
+    - Updated contrib/mmdsr to report preserved messages.
+
 2.1.12 (23-Feb-2009)
 
   Bug fixes and other patches
diff --git a/contrib/mmdsr b/contrib/mmdsr
index a8f11b43..cad14032 100644
--- a/contrib/mmdsr
+++ b/contrib/mmdsr
@@ -168,6 +168,10 @@
 #		Changed processing of fromusenet posts.  Previously, mmdsr
 #		reported as gated only the first and last of a gated range.
 #		Now mmdsr reports every post from the 'posted to' entries.
+#
+# 0.0.20	Update by Mark Sapiro <mark@msapiro.net>
+#		Updated on: Sun Jul 26 08:56:41 PDT 2009
+#		Added report of files in the preserved messages directory.
 
 ###############################################################################
 # Set up locations of standard commands, directories, etc....
@@ -216,6 +220,11 @@ LOGDIR="/usr/local/mailman/logs"
 ###############################################################################
 DATADIR="/usr/local/mailman/data"
 
+###############################################################################
+# Mailman preserved messages directory
+###############################################################################
+SPAMDIR="/usr/local/mailman/spam"
+
 ###############################################################################
 # Maximum number of subdirectory entries to display in report
 ###############################################################################
@@ -594,6 +603,33 @@ echo "" >> $TMP
 $AWK '{ print $NF }' $TMPLOG | $GREP -i '^heldmsg-' | $SED -e 's/^heldmsg-//' -e 's/-[0-9]*\.pck$//' | $SORT | $UNIQ -c | $SORT -nr >> $TMP
 echo "" >> $TMP
 
+if [ -d $SPAMDIR ] ; then
+    cd $SPAMDIR
+    $RM -f $TMPLOG
+    $TOUCH $TMPLOG
+    $LS -la | $GREP -i '\.msg$' >> $TMPLOG
+    LINES=`$WC -l < $TMPLOG`
+    
+    echo "******************************" >> $TMP
+    echo "Preserved Messages Directory Contents" >> $TMP
+    echo "        (.msg files only)" >> $TMP
+    echo "******************************" >> $TMP
+    echo "Files: $LINES" >> $TMP
+    echo "==============================" >> $TMP
+    echo "" >> $TMP
+    
+    if [ $LINES -le $MAX_DATA_LINES ] ; then
+        $CAT $TMPLOG >> $TMP
+    else
+        $HEAD $TMPLOG >> $TMP
+        echo "" >> $TMP
+        echo "  More than $MAX_DATA_LINES total entries, skipping ..." >> $TMP
+        echo "" >> $TMP
+        $TAIL $TMPLOG >> $TMP
+    fi
+    echo "" >> $TMP
+fi
+
 ###############################################################################
 # Okay, we're done with all the code stuff, now handle the output
 ###############################################################################
-- 
cgit v1.2.3