mhonarc-commits
[Top] [All Lists]

CVS: mhonarc/MHonArc/lib mhamain.pl,2.52,2.53 mhutil.pl,2.21,2.22 mhinit.pl...

2002-12-18 22:07:27
Update of /cvsroot/mhonarc/mhonarc/MHonArc/lib
In directory subversions:/tmp/cvs-serv10139

Modified Files:
	mhamain.pl mhutil.pl mhinit.pl 
Log Message:
* Fixed processing of message-id and address detection.  Now,
  text is properly treated as HTML text, where entity references
  may exist.  Converting '@' to ( exposed problem.


Index: mhamain.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhamain.pl,v
retrieving revision 2.52
retrieving revision 2.53
diff -C2 -r2.52 -r2.53
*** mhamain.pl	20 Nov 2002 23:53:12 -0000	2.52
--- mhamain.pl	19 Dec 2002 05:07:20 -0000	2.53
***************
*** 1133,1137 ****
  	    # check if subject header delimited
  	    if (/<!--X-Subject-Header-Begin/) {
! 		$tmp2 =~ s%($AddrExp)%&link_refmsgid($1,1)%geo;
  		print $msghandle $tmp2;
  		$tmp2 = "";
--- 1133,1137 ----
  	    # check if subject header delimited
  	    if (/<!--X-Subject-Header-Begin/) {
! 		$tmp2 =~ s/($HAddrExp)/&link_refmsgid($1,1)/geo;
  		print $msghandle $tmp2;
  		$tmp2 = "";
***************
*** 1149,1153 ****
  	    # check if head/body separator delimited
  	    if (/<!--X-Head-Body-Sep-Begin/) {
! 		$tmp2 =~ s%($AddrExp)%&link_refmsgid($1,1)%geo;
  		print $msghandle $tmp2;
  		$tmp2 = "";
--- 1149,1153 ----
  	    # check if head/body separator delimited
  	    if (/<!--X-Head-Body-Sep-Begin/) {
! 		$tmp2 =~ s/($HAddrExp)/&link_refmsgid($1,1)/geo;
  		print $msghandle $tmp2;
  		$tmp2 = "";
***************
*** 1167,1171 ****
  	    last  if /<!--X-MsgBody-End/;
  	}
! 	$tmp2 =~ s%($AddrExp)%&link_refmsgid($1,1)%geo;
  	print $msghandle $tmp2;
  
--- 1167,1171 ----
  	    last  if /<!--X-MsgBody-End/;
  	}
! 	$tmp2 =~ s/($HAddrExp)/&link_refmsgid($1,1)/geo;
  	print $msghandle $tmp2;
  
***************
*** 1178,1183 ****
  	print $msghandle "<!--X-Subject-Header-End-->\n";
  
! 	$MsgHead{$index} =~ s%($AddrExp)%&link_refmsgid($1)%geo;
! 	$Message{$index} =~ s%($AddrExp)%&link_refmsgid($1)%geo;
  
  	print $msghandle "<!--X-Head-of-Message-->\n";
--- 1178,1183 ----
  	print $msghandle "<!--X-Subject-Header-End-->\n";
  
! 	$MsgHead{$index} =~ s/($HAddrExp)/&link_refmsgid($1)/geo;
! 	$Message{$index} =~ s/($HAddrExp)/&link_refmsgid($1)/geo;
  
  	print $msghandle "<!--X-Head-of-Message-->\n";
***************
*** 1374,1388 ****
  ##
  sub link_refmsgid {
!     my($refmsgid, $onlynew) = @_;
  
      if (defined($MsgId{$refmsgid}) &&
! 	defined($IndexNum{$MsgId{$refmsgid}}) &&
! 	(!$onlynew || $NewMsgId{$refmsgid})) {
  	my($lreftmpl) = $MSGIDLINK;
  	$lreftmpl =~ s/$VarExp/&replace_li_var($1,$MsgId{$refmsgid})/geo;
! 	$lreftmpl;
!     } else {
! 	$refmsgid;
      }
  }
  
--- 1374,1388 ----
  ##
  sub link_refmsgid {
!     my $refmsgid = dehtmlize(shift);
!     my $onlynew  = shift;
  
      if (defined($MsgId{$refmsgid}) &&
! 	    defined($IndexNum{$MsgId{$refmsgid}}) &&
! 	    (!$onlynew || $NewMsgId{$refmsgid})) {
  	my($lreftmpl) = $MSGIDLINK;
  	$lreftmpl =~ s/$VarExp/&replace_li_var($1,$MsgId{$refmsgid})/geo;
! 	return $lreftmpl;
      }
+     htmlize($refmsgid);
  }
  

Index: mhutil.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhutil.pl,v
retrieving revision 2.21
retrieving revision 2.22
diff -C2 -r2.21 -r2.22
*** mhutil.pl	18 Dec 2002 05:44:27 -0000	2.21
--- mhutil.pl	19 Dec 2002 05:07:20 -0000	2.22
***************
*** 497,509 ****
  	if ($HFieldsAddr{$label}) {
  	    if (!$NOMAILTO) {
! 		$fld_text =~ s|([\!\%\w\.\-+=/]+(_at_)[\w\(_dot_)\-]+)
! 			      |&mailUrl($1, $fields->{'x-mha-message-id'},
  					    $fields->{'x-mha-subject'},
  					    $fields->{'x-mha-from'});
! 			      |gex;
  	    } else {
! 		$fld_text =~ s|([\!\%\w\.\-+=/]+(_at_)[\w\(_dot_)\-]+)
! 			      |&htmlize(&rewrite_address($1))
! 			      |gex;
  	    }
  	    last LBLSW;
--- 497,509 ----
  	if ($HFieldsAddr{$label}) {
  	    if (!$NOMAILTO) {
! 		$fld_text =~ s{($HAddrExp)}
! 			      {&mailUrl($1, $fields->{'x-mha-message-id'},
  					    $fields->{'x-mha-subject'},
  					    $fields->{'x-mha-from'});
! 			      }gexo;
  	    } else {
! 		$fld_text =~ s{($HAddrExp)}
! 			      {&htmlize(&rewrite_address($1))
! 			      }gex;
  	    }
  	    last LBLSW;
***************
*** 545,548 ****
--- 545,549 ----
      my $sub = shift || '';
      my $from = shift || '';
+     dehtmlize(\$eaddr);
  
      local $_;

Index: mhinit.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhinit.pl,v
retrieving revision 2.39
retrieving revision 2.40
diff -C2 -r2.39 -r2.40
*** mhinit.pl	20 Nov 2002 23:53:12 -0000	2.39
--- mhinit.pl	19 Dec 2002 05:07:20 -0000	2.40
***************
*** 283,287 ****
  
  ##  Regexp for address/msg-id detection (looks like cussing in cartoons)
! $AddrExp = '[^()<>@,;:\/\s"\'&|]+(_at_)[^()<>@,;:\/\s"\'&|]+';
  
  ##  Text clipping function and source file: Set in mhopt.pl.
--- 283,288 ----
  
  ##  Regexp for address/msg-id detection (looks like cussing in cartoons)
! $AddrExp  = '[^()<>@,;:\/\s"\'&|]+(_at_)[^()<>@,;:\/\s"\'&|]+';
! $HAddrExp = '[^()<>@,;:\/\s"\'&|]+(?:@|&\#[xX]0*40;|&64;)[^()<>@,;:\/\s"\'&|]+';
  
  ##  Text clipping function and source file: Set in mhopt.pl.

---------------------------------------------------------------------
To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the
message text UNSUBSCRIBE MHONARC-DEV