Great Circle Associates Majordomo-Workers
(April 2000)
 

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

Subject: resend 1.94.5 patch
From: John Relph <relph @ cthulhu . engr . sgi . com>
Date: Fri, 21 Apr 2000 14:40:25 -0700 (PDT)
To: majordomo-workers @ greatcircle . com
Reply-to: relph @ sgi . com


Folks,

I don't know what's happening, but my posts aren't getting to the
list, so I'm trying again.

Here's a patch for "resend" which bounces messages that have no
"Subject:" line.  I suppose it should be configurable, but this patch
is not.  I use this patch and have for some time.

	-- John

*** resend.ORIG Fri Mar 24 09:48:58 2000
--- resend      Fri Mar 24 09:56:36 2000
***************
*** 579,584 ****
--- 579,585 ----
  sub parse_header {
      local($gonna_bounce);
      local($kept_last) = 0;                          # our return flag/string.
+     local($subject_found) = 0;
  
      print STDERR "$0: parse_header: enter.\n" if $DEBUG;
      print STDERR "$0: parse_header:  taboo_headers = $is_taboo_header\n" if $DEBUG;
***************
*** 700,713 ****
  
        # prepend subject prefix
        #
!       if ( (/^subject:\s*/i) 
!           && ($config_opts{$opt_l,"subject_prefix"} ne '')) {
  
!           print STDERR "$0: parse_header: adding subject prefix\n" if $DEBUG;
!           local($foo) = &config'substitute_values($config_opts{$opt_l,"subject_prefix"}, $opt_l);#';
!           local($foo_pat) = $foo;
!           $foo_pat =~ s/(\W)/\\$1/g;
!           s/^subject:[^\S\n]*/Subject: $foo /i if !/$foo_pat/; 
        }
        
        # snag reply-to field 
--- 701,716 ----
  
        # prepend subject prefix
        #
!       if (/^subject:\s*/i) {
!           if ($config_opts{$opt_l,"subject_prefix"} ne '') {
  
!               print STDERR "$0: parse_header: adding subject prefix\n" if $DEBUG;
!               local($foo) = &config'substitute_values($config_opts{$opt_l,"subject_prefix"}, $opt_l);#';
!               local($foo_pat) = $foo;
!               $foo_pat =~ s/(\W)/\\$1/g;
!               s/^subject:[^\S\n]*/Subject: $foo /i if !/$foo_pat/; 
!           }
!           $subject_found = 1;
        }
        
        # snag reply-to field 
***************
*** 754,760 ****
      if (defined($opt_r)) {
        print OUT "Reply-To: ", &config'substitute_values($opt_r), "\n";   #';
      }
!     
      # print out per-list additonal headers
      if ( $config_opts{$opt_l,"message_headers"} ne '' ) {
        local($headers) = &config'substitute_values (
--- 757,775 ----
      if (defined($opt_r)) {
        print OUT "Reply-To: ", &config'substitute_values($opt_r), "\n";   #';
      }
! 
!     if ($subject_found == 0) {
!       if ($config_opts{$opt_l,"subject_prefix"} ne '') {
! 
!           print STDERR "$0: parse_header: adding subject prefix\n" if $DEBUG;
!           print OUT "Subject: ",
!               &config'substitute_values($config_opts{$opt_l,"subject_prefix"}, $opt_l), #'
!               " (none)\n";
!       }
!       $gonna_bounce .= "Missing Subject line ";
!       print STDERR "$0: parse_header: [$.] boing: $gonna_bounce\n" if $DEBUG;
!     }
! 
      # print out per-list additonal headers
      if ( $config_opts{$opt_l,"message_headers"} ne '' ) {
        local($headers) = &config'substitute_values (


Follow-Ups:
Indexed By Date Previous: Silence
From: John Relph <relph@cthulhu.engr.sgi.com>
Next: Re: Silence
From: relph@mando.engr.sgi.com (John Relph)
Indexed By Thread Previous: Re: Silence
From: relph@mando.engr.sgi.com (John Relph)
Next: Re: resend 1.94.5 patch
From: Dave Wolfe <dwolfe@lists.linuxppc.org>

Google
 
Search Internet Search www.greatcircle.com