Re: ezmlm-weed blocking bounce messages?

Bruce Guenter <[email protected]> Wed, 11 Jul 2007 21:19:27 -0600
Newsgroups gmane.mail.ezmlm
Message-ID <[email protected]>
On Fri, Feb 09, 2007 at 08:27:42AM -0500, Matt Simpson wrote:
> I guessed that maybe ezmlm-weed was throwing away the messages before 
> ezmlm-return saw them, so I commented out the ezmlm-weed line.  My 
> guess was correct, and after ezmlm-weed was commented out, the 
> bounces ended up in the bounce directory.  They look like legitimate 
> bounces for a non-existent user, so I don't know why ezmlm-weed 
> thought they were weeds.

You are correct.  ezmlm-weed was coded to recognize MIME DSNs, but had
some faulty logic in handling them properly.  The following patch works
for me on the one MIME DSN example I found.  Please let me know how it
works for you.
-- 
Bruce Guenter <[email protected]>                http://untroubled.org/
	I do custom software development.  Email me for details.

--- ezmlm-weed.c	(revision 663)
+++ ezmlm-weed.c	(working copy)
@@ -64,11 +64,10 @@
   for (;;) {
     get(&line);
     if (line.len == 1) break;
-    if (line.s[0] == ' ' || line.s[0] == '\t') {	/* continuation */
-      if (flagdsn) {
+    if (flagdsn) {
+      if (line.s[0] == ' ' || line.s[0] == '\t')	/* continuation */
 	if (!stralloc_catb(&dsnline,line.s,line.len - 1)) die_nomem();
-	continue;
-      }
+      continue;
     }
     flagdsn = 0;
     if (stralloc_starts(&line,"Subject: success notice"))
@@ -129,12 +128,13 @@
       flagsr = 1;
     if (stralloc_starts(&line,"Auto-Submitted: auto-generated (warning"))
       flagas = 1;
-    if (case_startb(line.s,line.len,"Content-type: multipart/report"))
+    if (case_startb(line.s,line.len,"Content-type: multipart/report")) {
       if (!stralloc_copyb(&dsnline,line.s,line.len - 1)) die_nomem();
       flagdsn = 1;
+    }
   }			/* end of header */
 
-  if (flagdsn) {	/* always only one recipient/action */
+  if (dsnline.len > 0) {	/* always only one recipient/action */
     flagdsn = 0;	/* will be set for correct report type */
     for (i=0; i < dsnline.len; i += 1+byte_chr(dsnline.s+i,dsnline.len-i,';')) {
       while (dsnline.s[i] == ' ' || dsnline.s[i] == '\t')
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFGlZ2/6W+y3GmZgOgRAgObAKCkAq+dEqejG0/Ful3lyFNs4lu/0ACfeHai
1MAdZ0+cdNroM9DWFdT8onE=
=qpgB
-----END PGP SIGNATURE-----