Great Circle Associates Majordomo-Users
(September 1993)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Bugs in version 1.60?
From: parker @ mprgate . mpr . ca (Ross Parker)
Date: Fri, 3 Sep 93 12:08:43 PDT
To: majordomo-users @ GreatCircle . COM

I've found a couple of problems in 'resend' in Majordomo version 1.60...


They are:

1) If an 'Approved:' header line is supplied as the first line of the
   body of an email message (as now supported in version 1.60), resend
   closes and unlinks the temp file it's using, then opens it again and
   only sticks the 'Approved:' line in. This means that sendmail only
   ever sees an 'Approved' header line, and all the rest of the header
   information is lost (subject line, etc).

2) The admin-request heuristic code uses a variable '$body_line', which
   I suspect should be '$body_len' (as used elsewhere).

Here's some context diffs that fix both of these:

***************
*** 101,107 ****
                    print OUT "Reply-To: $opt_r@$opt_h\n";
                }
                $in_hdr = 0;
-               print OUT $_;
            } elsif (/^approved:\s*(.*)/i && defined($opt_a)) {
                $approved = &chop_nl($1);
                if ($approved ne $opt_a) {
--- 101,106 ----
***************
*** 161,173 ****
                    # Yes, it's a valid "Approved:" line...
                    # So, we start over
                    $restart = 1;
-                   close(OUT);
-                   unlink("/tmp/resend.$$.out");
-                   open(OUT, ">/tmp/resend.$$.out") ||
-                       die("resend: Can't open /tmp/resend.$$.out: $!");
                    last;
                }
            }
            # make sure it doesn't make the message too long
            if (defined($opt_M) && ! defined($approved)
                    && ($body_len += length($_)) > $opt_M) {
--- 160,171 ----
                    # Yes, it's a valid "Approved:" line...
                    # So, we start over
                    $restart = 1;
                    last;
                }
            }
+           if ($body_len == 0) {
+               print OUT "\n";
+           }
            # make sure it doesn't make the message too long
            if (defined($opt_M) && ! defined($approved)
                    && ($body_len += length($_)) > $opt_M) {
***************
*** 174,180 ****
                &bounce("Message too long (>$opt_M)");
            }
            # add admin-request recognition heuristics here... (body)
!           if (defined($opt_s) && ! defined($approved) && ($body_line++ < 5) && (
                /\badd me\b/i
                || /\bdelete me\b/i
                || /\bsubscribe\b/i || /^sub\b/i
--- 172,178 ----
                &bounce("Message too long (>$opt_M)");
            }
            # add admin-request recognition heuristics here... (body)
!           if (defined($opt_s) && ! defined($approved) && ($body_len++ < 5) && (
                /\badd me\b/i
                || /\bdelete me\b/i
                || /\bsubscribe\b/i || /^sub\b/i




I would also suggest that it may be a good thing to allow for the addition
of a 'Reply-To:' header line in the body of the message in the same way
that 'Approved:' is now supported. This is helpful in the situation where
replies to a list should go to someone other than either the default
(specified with the '-r reply-addr' option) or the originator of the
message. This certainly happens at our site...

Mods to 'resend' to support this (line #s based on code patched with
the above patches):


***************
*** 162,167 ****
--- 162,173 ----
                    $restart = 1;
                    last;
                }
+           } elsif (($body_len == 0) && /^reply-to:/i && !defined($opt_r)) {
+               # It's a valid "Reply-To:" line...
+               # So, we start over
+               $restart = 1;
+               print OUT $_;
+               last;
            }
            if ($body_len == 0) {
                print OUT "\n";




Ross
__
Ross Parker           | DoD#1188 KotHFJ '88 FJ1200, '64 Matchless G80CS (500cc)
MPR Teltech Ltd.      | "Disease and deprivation stalk the land
Burnaby, B.C., Canada | like two giant....   stalking things."
parker@mprgate.mpr.ca | (Rowan Atkinson - Black Adder the Third)


Indexed By Date Previous: Re: Using Majordomo
From: Brent Chapman <brent@GreatCircle.COM>
Next: Patch for 1.60 approve
From: "John P. Rouillard" <rouilj@cs.umb.edu>
Indexed By Thread Previous: Majordomo Version 1.60 now available
From: Brent Chapman <brent@GreatCircle.COM>
Next: Patch for 1.60 approve
From: "John P. Rouillard" <rouilj@cs.umb.edu>

Google
 
Search Internet Search www.greatcircle.com