From: Santiago Vila <sanvila@debian.org>
Subject: Use a random boundary for multipart/digest messages
X-Debian-version: 3.15-10

--- a/SmartList/bin/digest
+++ b/SmartList/bin/digest
@@ -24,6 +24,7 @@
 digestadmin2=archive/latest/$digestadmin
 digestbody=archive/latest/digest.body
 digesttrailer=archive/latest/digest.trailer
+digestboundary=archive/latest/digest.boundary
 
 if $test -z "$alt_sendmail"
 then
@@ -57,11 +58,11 @@
   while(lines)
    { print("");--lines;
    }
-  if(mtch==3)
-     print("- ----------------------------");
-  else if(mtch==4)
-     print("- ------------------------------");
-  else if(mtch==5)
+#  if(mtch==3)
+#     print("- ----------------------------");
+#  else if(mtch==4)
+#     print("- ------------------------------");
+  if(mtch==5)
      printf(" .");
   else
      print($0);
@@ -70,8 +71,18 @@
 
 $test -f $digestbody && flush_digests -c
 
+if [ ! -f $digestboundary ]; then
+  if [ -f $digestbody ]; then
+    echo "----------------------------" > $digestboundary
+  else
+    date +%Y%m%d%H%M%S | md5sum | awk '{ print $1 }' > $digestboundary
+  fi
+fi
+
+boundary=`cat $digestboundary`
+
 $cat >>$digestbody <<HERE
-------------------------------
+--$boundary
 
 HERE
 
@@ -120,12 +131,12 @@
 X-Mailing-List: <$listaddr> archive/volume$Year/$Issue
 Precedence: list
 MIME-Version: 1.0
-Content-Type: multipart/digest; boundary="----------------------------"
+Content-Type: multipart/digest; boundary="$boundary"
 To: $listaddr${reply_to+
 }${reply_to-${undigested_list+
 Reply-To: }$undigested_list}
 
-------------------------------
+--$boundary
 
 Content-Type: text/plain
 
@@ -135,7 +146,7 @@
 HERE
 
   $cat >$digesttrailer <<HERE
---------------------------------
+--$boundary--
 End of $list Digest V$Year Issue #$Issue
 HERE
   b=`$sed -n -e '$ s/./*/gp' <$digesttrailer`
--- a/SmartList/bin/flush_digests
+++ b/SmartList/bin/flush_digests
@@ -34,6 +34,7 @@
 tmpfrom=tmp.from
 
 digestbody=archive/latest/digest.body
+digestboundary=archive/latest/digest.boundary
 
 if $test .-c = ".$1"
 then
@@ -81,6 +82,7 @@
      $cat $digestbody $digesttrailer >>$Issue 2>/dev/null
      $rm -f $digesttrailer $digestbody $digestadmin2
      $SENDMAIL <$Issue
+     date +%Y%m%d%H%M%S | md5sum | awk '{ print $1 }' > $digestboundary
      cd archive
      $rm -f _dummy_ \
  `$ls -td volume*/* | $sed -e '/\/.*[^0-9]/ d' | $sed -e '1,'$archive_hist' d'`
