mhonarc-commits
[Top] [All Lists]

CVS: mhonarc/MHonArc/lib mhinit.pl,2.37,2.38 mhopt.pl,2.32,2.33 readmail.pl...

2002-11-13 17:41:17
Update of /cvsroot/mhonarc/mhonarc/MHonArc/lib
In directory subversions:/tmp/cvs-serv22610

Modified Files:
	mhinit.pl mhopt.pl readmail.pl 
Log Message:
* BUG FIX: #1506.  Initialization of readmail variables done after
  database is loaded.  The problem was that the $IsDefault{XXX} flags
  for the MIME* resources were still true from core initialization
  after readmail::* vars were loaded from .mhonarc.db, causing them
  to not be saved in subsequent archive edits.


Index: mhinit.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhinit.pl,v
retrieving revision 2.37
retrieving revision 2.38
diff -C2 -r2.37 -r2.38
*** mhinit.pl	4 Sep 2002 04:09:30 -0000	2.37
--- mhinit.pl	14 Nov 2002 00:40:59 -0000	2.38
***************
*** 275,281 ****
  $DBPathName	= '';	# Full pathname of database file
  
- ##  Initialize readmail variables
- mhinit_readmail_vars();
- 
  ##  Variable to hold function for converting message header text.
  $MHeadCnvFunc	= "mhonarc::htmlize";
--- 275,278 ----
***************
*** 599,752 ****
  		#	indexes of messages or for processing
  		#	old version data.
- 
- }
- 
- ##---------------------------------------------------------------------------##
- 
- sub mhinit_readmail_vars {
- 
- ##----------------------------------------------------------------------
- ##	Default filters
- ##
- %readmail::MIMEFilters = (
-     # Content-type			Filter
-     #-------------------------------------------------------------------
-     "application/ms-tnef",		"m2h_null::filter",
-     "application/octet-stream",		"m2h_external::filter",
-     "application/x-patch",		"m2h_text_plain::filter",
-     "message/delivery-status",  	"m2h_text_plain::filter",
-     "message/external-body",   		"m2h_msg_extbody::filter",
-     "message/partial",   		"m2h_text_plain::filter",
-     "text/enriched",    		"m2h_text_enriched::filter",
-     "text/html",			"m2h_text_html::filter",
-     "text/plain",			"m2h_text_plain::filter",
-     "text/richtext",    		"m2h_text_enriched::filter",
-     "text/setext",			"m2h_text_setext::filter",
-     "text/tab-separated-values",	"m2h_text_tsv::filter",
-     "text/x-html",			"m2h_text_html::filter",
-     "text/x-setext",    		"m2h_text_setext::filter",
- 
-     "application/*",		 	"m2h_external::filter",
-     "audio/*",				"m2h_external::filter",
-     "chemical/*",  			"m2h_external::filter",
-     "image/*",  			"m2h_external::filter",
-     "model/*",  			"m2h_external::filter",
-     "text/*",   			"m2h_text_plain::filter",
-     "video/*",  			"m2h_external::filter",
- 
-     "x-sun-attachment",			"m2h_text_plain::filter",
- );
- %readmail::MIMEFiltersSrc = (
-     # Content-type			Filter
-     #-------------------------------------------------------------------
-     "application/ms-tnef",		"mhnull.pl",
-     "application/octet-stream",		"mhexternal.pl",
-     "application/x-patch",		"mhtxtplain.pl",
-     "message/delivery-status",  	"mhtxtplain.pl",
-     "message/external-body",   		"mhmsgextbody.pl",
-     "message/partial",   		"mhtxtplain.pl",
-     "text/enriched",    		"mhtxtenrich.pl",
-     "text/html",			"mhtxthtml.pl",
-     "text/plain",			"mhtxtplain.pl",
-     "text/richtext",    		"mhtxtenrich.pl",
-     "text/setext",			"mhtxtsetext.pl",
-     "text/tab-separated-values",	"mhtxttsv.pl",
-     "text/x-html",			"mhtxthtml.pl",
-     "text/x-setext",    		"mhtxtsetext.pl",
- 
-     "application/*",		 	"mhexternal.pl",
-     "audio/*",				"mhexternal.pl",
-     "chemical/*",  			"mhexternal.pl",
-     "image/*",  			"mhexternal.pl",
-     "model/*",  			"mhexternal.pl",
-     "text/*",   			"mhtxtplain.pl",
-     "video/*",  			"mhexternal.pl",
- 
-     "x-sun-attachment",			"mhtxtplain.pl",
- );
- $IsDefault{'MIMEFILTERS'} = 1;
- 
- ##  Default filter arguments
- ##
- %readmail::MIMEFiltersArgs = (
-     # Content-type			Arguments
-     #-------------------------------------------------------------------
-     'm2h_external::filter',		'inline',
- );
- $IsDefault{'MIMEARGS'} = 1;
- 
- ##  Charset filters
- ##
- %readmail::MIMECharSetConverters = (
-     # Character set			Converter Function
-     #-------------------------------------------------------------------
-     "plain",     			"mhonarc::htmlize",
-     "us-ascii",   			"mhonarc::htmlize",
-     "iso-8859-1",   			"mhonarc::htmlize",
-     "iso-8859-2",   			"MHonArc::CharEnt::str2sgml",
-     "iso-8859-3",   			"MHonArc::CharEnt::str2sgml",
-     "iso-8859-4",   			"MHonArc::CharEnt::str2sgml",
-     "iso-8859-5",   			"MHonArc::CharEnt::str2sgml",
-     "iso-8859-6",   			"MHonArc::CharEnt::str2sgml",
-     "iso-8859-7",   			"MHonArc::CharEnt::str2sgml",
-     "iso-8859-8",   			"MHonArc::CharEnt::str2sgml",
-     "iso-8859-9",   			"MHonArc::CharEnt::str2sgml",
-     "iso-8859-10",   			"MHonArc::CharEnt::str2sgml",
-     "iso-8859-15",   			"MHonArc::CharEnt::str2sgml",
-     "iso-2022-jp",   			"iso_2022_jp::str2html",
-     "latin1",   			"mhonarc::htmlize",
-     "latin2",   			"MHonArc::CharEnt::str2sgml",
-     "latin3",   			"MHonArc::CharEnt::str2sgml",
-     "latin4",   			"MHonArc::CharEnt::str2sgml",
-     "latin5",   			"MHonArc::CharEnt::str2sgml",
-     "latin6",   			"MHonArc::CharEnt::str2sgml",
-     "latin9",   			"MHonArc::CharEnt::str2sgml",
-     "windows-1250",   			"MHonArc::CharEnt::str2sgml",
-     "windows-1252",   			"MHonArc::CharEnt::str2sgml",
-     "default",     			"-ignore-",
- );
- %readmail::MIMECharSetConvertersSrc = (
-     # Character set			Converter Function
-     #-------------------------------------------------------------------
-     "plain",     			undef,
-     "us-ascii",   			undef,
-     "iso-8859-1",   			undef,
-     "iso-8859-2",   			"MHonArc/CharEnt.pm",
-     "iso-8859-3",   			"MHonArc/CharEnt.pm",
-     "iso-8859-4",   			"MHonArc/CharEnt.pm",
-     "iso-8859-5",   			"MHonArc/CharEnt.pm",
-     "iso-8859-6",   			"MHonArc/CharEnt.pm",
-     "iso-8859-7",   			"MHonArc/CharEnt.pm",
-     "iso-8859-8",   			"MHonArc/CharEnt.pm",
-     "iso-8859-9",   			"MHonArc/CharEnt.pm",
-     "iso-8859-10",   			"MHonArc/CharEnt.pm",
-     "iso-8859-15",   			"MHonArc/CharEnt.pm",
-     "iso-2022-jp",   			"iso2022jp.pl",
-     "latin1",   			undef,
-     "latin2",   			"MHonArc/CharEnt.pm",
-     "latin3",   			"MHonArc/CharEnt.pm",
-     "latin4",   			"MHonArc/CharEnt.pm",
-     "latin5",   			"MHonArc/CharEnt.pm",
-     "latin6",   			"MHonArc/CharEnt.pm",
-     "latin9",   			"MHonArc/CharEnt.pm",
-     "windows-1250",   			"MHonArc/CharEnt.pm",
-     "windows-1252",   			"MHonArc/CharEnt.pm",
-     "default",     			undef,
- );
- $IsDefault{'CHARSETCONVERTERS'} = 1;
- 
- ##  Content-Transfer-Encoding decoders:
- ##    readmail.pl has a default set, so we just use it.
- $IsDefault{'MIMEDECODERS'} = 1;
- 
- ##  Content-Types to exclude:
- ##    Nothing is excluded by default.
- $IsDefault{'MIMEEXCS'} = 1;
- 
- ##  Content-type multipart/alternative preferences
- ##    Note: The variable is not a readmail package variable, but it
- ##	    is used to set readmail package properties.
- @MIMEAltPrefs = ( );
- $IsDefault{'MIMEALTPREFS'} = 1;
  
  }
--- 596,599 ----

Index: mhopt.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhopt.pl,v
retrieving revision 2.32
retrieving revision 2.33
diff -C2 -r2.32 -r2.33
*** mhopt.pl	20 Oct 2002 03:49:22 -0000	2.32
--- mhopt.pl	14 Nov 2002 00:40:59 -0000	2.33
***************
*** 8,12 ****
  ##---------------------------------------------------------------------------##
  ##    MHonArc -- Internet mail-to-HTML converter
! ##    Copyright (C) 1997-1999	Earl Hood, mhonarc(_at_)mhonarc(_dot_)org
  ##
  ##    This program is free software; you can redistribute it and/or modify
--- 8,12 ----
  ##---------------------------------------------------------------------------##
  ##    MHonArc -- Internet mail-to-HTML converter
! ##    Copyright (C) 1997-2002	Earl Hood, mhonarc(_at_)mhonarc(_dot_)org
  ##
  ##    This program is free software; you can redistribute it and/or modify
***************
*** 409,412 ****
--- 409,415 ----
      $THREAD = 0  if $IDXONLY;
  
+     ## Set mail parsing variables.
+     mhinit_readmail_vars();
+ 
      ##	Read resource file(s) (I initially used the term 'format file').
      ##	Look for resource in outdir unless existing according to
***************
*** 788,791 ****
--- 791,970 ----
  	next  if ref($value);
  	$Derived{$index} = [ split(/$X/o, $value) ];
+     }
+ }
+ 
+ ##---------------------------------------------------------------------------
+ ##	Initialize readmail.pl variables
+ ##
+ sub mhinit_readmail_vars {
+     unless (%readmail::MIMEDecoders) {
+ 	%readmail::MIMEDecoders = (
+ 	    '7bit'	       => 'as-is',
+ 	    '8bit'             => 'as-is',
+ 	    'binary'           => 'as-is',
+ 	    'base64'           => 'base64::b64decode',
+ 	    'quoted-printable' => 'quoted_printable::qprdecode',
+ 	    'x-uuencode'       => 'base64::uudecode',
+ 	    'x-uue'            => 'base64::uudecode',
+ 	    'uuencode'         => 'base64::uudecode',
+ 	);
+ 	%readmail::MIMEDecodersSrc = (
+ 	    'base64'           => 'base64.pl',
+ 	    'quoted-printable' => 'qprint.pl',
+ 	    'x-uuencode'       => 'base64.pl',
+ 	    'x-uue'            => 'base64.pl',
+ 	    'uuencode'         => 'base64.pl',
+ 	);
+ 	$IsDefault{'MIMEDECODERS'} = 1;
+     }
+ 
+     ##----------------------------------------------------------------------
+     ##	Default filters
+     ##
+     unless (%readmail::MIMEFilters) {
+ 	%readmail::MIMEFilters = (
+ 	    # Content-type			Filter
+ 	    #-------------------------------------------------------------------
+ 	    "application/ms-tnef",		"m2h_null::filter",
+ 	    "application/octet-stream",		"m2h_external::filter",
+ 	    "application/x-patch",		"m2h_text_plain::filter",
+ 	    "message/delivery-status",  	"m2h_text_plain::filter",
+ 	    "message/external-body",		"m2h_msg_extbody::filter",
+ 	    "message/partial",   		"m2h_text_plain::filter",
+ 	    "text/enriched",    		"m2h_text_enriched::filter",
+ 	    "text/html",			"m2h_text_html::filter",
+ 	    "text/plain",			"m2h_text_plain::filter",
+ 	    "text/richtext",    		"m2h_text_enriched::filter",
+ 	    "text/setext",			"m2h_text_setext::filter",
+ 	    "text/tab-separated-values",	"m2h_text_tsv::filter",
+ 	    "text/x-html",			"m2h_text_html::filter",
+ 	    "text/x-setext",    		"m2h_text_setext::filter",
+ 
+ 	    "application/*",			"m2h_external::filter",
+ 	    "audio/*",				"m2h_external::filter",
+ 	    "chemical/*",  			"m2h_external::filter",
+ 	    "image/*",  			"m2h_external::filter",
+ 	    "model/*",  			"m2h_external::filter",
+ 	    "text/*",   			"m2h_text_plain::filter",
+ 	    "video/*",  			"m2h_external::filter",
+ 
+ 	    "x-sun-attachment",			"m2h_text_plain::filter",
+ 	);
+ 
+ 	%readmail::MIMEFiltersSrc = (
+ 	    # Content-type			Filter
+ 	    #-------------------------------------------------------------------
+ 	    "application/ms-tnef",		"mhnull.pl",
+ 	    "application/octet-stream",		"mhexternal.pl",
+ 	    "application/x-patch",		"mhtxtplain.pl",
+ 	    "message/delivery-status",  	"mhtxtplain.pl",
+ 	    "message/external-body",		"mhmsgextbody.pl",
+ 	    "message/partial",   		"mhtxtplain.pl",
+ 	    "text/enriched",    		"mhtxtenrich.pl",
+ 	    "text/html",			"mhtxthtml.pl",
+ 	    "text/plain",			"mhtxtplain.pl",
+ 	    "text/richtext",    		"mhtxtenrich.pl",
+ 	    "text/setext",			"mhtxtsetext.pl",
+ 	    "text/tab-separated-values",	"mhtxttsv.pl",
+ 	    "text/x-html",			"mhtxthtml.pl",
+ 	    "text/x-setext",    		"mhtxtsetext.pl",
+ 
+ 	    "application/*",			"mhexternal.pl",
+ 	    "audio/*",				"mhexternal.pl",
+ 	    "chemical/*",  			"mhexternal.pl",
+ 	    "image/*",  			"mhexternal.pl",
+ 	    "model/*",  			"mhexternal.pl",
+ 	    "text/*",   			"mhtxtplain.pl",
+ 	    "video/*",  			"mhexternal.pl",
+ 
+ 	    "x-sun-attachment",			"mhtxtplain.pl",
+ 	);
+ 	$IsDefault{'MIMEFILTERS'} = 1;
+     }
+ 
+     ##  Default filter arguments
+     ##
+     unless (%readmail::MIMEFiltersArgs) {
+ 	%readmail::MIMEFiltersArgs = (
+ 	    # Content-type			Arguments
+ 	    #-------------------------------------------------------------------
+ 	    'm2h_external::filter',		'inline',
+ 	);
+ 	$IsDefault{'MIMEARGS'} = 1;
+     }
+ 
+     ##  Charset filters
+     ##
+     unless (%readmail::MIMECharSetConverters) {
+ 	%readmail::MIMECharSetConverters = (
+ 	    # Character set		Converter Function
+ 	    #-------------------------------------------------------------------
+ 	    "plain",     		"mhonarc::htmlize",
+ 	    "us-ascii",   		"mhonarc::htmlize",
+ 	    "iso-8859-1",   		"mhonarc::htmlize",
+ 	    "iso-8859-2",   		"MHonArc::CharEnt::str2sgml",
+ 	    "iso-8859-3",   		"MHonArc::CharEnt::str2sgml",
+ 	    "iso-8859-4",   		"MHonArc::CharEnt::str2sgml",
+ 	    "iso-8859-5",   		"MHonArc::CharEnt::str2sgml",
+ 	    "iso-8859-6",   		"MHonArc::CharEnt::str2sgml",
+ 	    "iso-8859-7",   		"MHonArc::CharEnt::str2sgml",
+ 	    "iso-8859-8",   		"MHonArc::CharEnt::str2sgml",
+ 	    "iso-8859-9",   		"MHonArc::CharEnt::str2sgml",
+ 	    "iso-8859-10",   		"MHonArc::CharEnt::str2sgml",
+ 	    "iso-8859-15",   		"MHonArc::CharEnt::str2sgml",
+ 	    "iso-2022-jp",   		"iso_2022_jp::str2html",
+ 	    "latin1",   		"mhonarc::htmlize",
+ 	    "latin2",   		"MHonArc::CharEnt::str2sgml",
+ 	    "latin3",   		"MHonArc::CharEnt::str2sgml",
+ 	    "latin4",   		"MHonArc::CharEnt::str2sgml",
+ 	    "latin5",   		"MHonArc::CharEnt::str2sgml",
+ 	    "latin6",   		"MHonArc::CharEnt::str2sgml",
+ 	    "latin9",   		"MHonArc::CharEnt::str2sgml",
+ 	    "windows-1250",   		"MHonArc::CharEnt::str2sgml",
+ 	    "windows-1252",   		"MHonArc::CharEnt::str2sgml",
+ 	    "default",     		"-ignore-",
+ 	);
+ 	%readmail::MIMECharSetConvertersSrc = (
+ 	    # Character set		Converter Function
+ 	    #-------------------------------------------------------------------
+ 	    "plain",     		undef,
+ 	    "us-ascii",   		undef,
+ 	    "iso-8859-1",   		undef,
+ 	    "iso-8859-2",   		"MHonArc/CharEnt.pm",
+ 	    "iso-8859-3",   		"MHonArc/CharEnt.pm",
+ 	    "iso-8859-4",   		"MHonArc/CharEnt.pm",
+ 	    "iso-8859-5",   		"MHonArc/CharEnt.pm",
+ 	    "iso-8859-6",   		"MHonArc/CharEnt.pm",
+ 	    "iso-8859-7",   		"MHonArc/CharEnt.pm",
+ 	    "iso-8859-8",   		"MHonArc/CharEnt.pm",
+ 	    "iso-8859-9",   		"MHonArc/CharEnt.pm",
+ 	    "iso-8859-10",   		"MHonArc/CharEnt.pm",
+ 	    "iso-8859-15",   		"MHonArc/CharEnt.pm",
+ 	    "iso-2022-jp",   		"iso2022jp.pl",
+ 	    "latin1",   		undef,
+ 	    "latin2",   		"MHonArc/CharEnt.pm",
+ 	    "latin3",   		"MHonArc/CharEnt.pm",
+ 	    "latin4",   		"MHonArc/CharEnt.pm",
+ 	    "latin5",   		"MHonArc/CharEnt.pm",
+ 	    "latin6",   		"MHonArc/CharEnt.pm",
+ 	    "latin9",   		"MHonArc/CharEnt.pm",
+ 	    "windows-1250",   		"MHonArc/CharEnt.pm",
+ 	    "windows-1252",   		"MHonArc/CharEnt.pm",
+ 	    "default",     		undef,
+ 	);
+ 	$IsDefault{'CHARSETCONVERTERS'} = 1;
+     }
+ 
+     ##  Content-Types to exclude:
+     ##    Nothing is excluded by default.
+     unless (%readmail::MIMEExcs) {
+ 	$IsDefault{'MIMEEXCS'} = 1;
+     }
+ 
+     ##  Content-type multipart/alternative preferences
+     ##    Note: The variable is not a readmail package variable, but it
+     ##	    is used to set readmail package properties.
+     unless (@MIMEAltPrefs) {
+ 	$IsDefault{'MIMEALTPREFS'} = 1;
      }
  }

Index: readmail.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/readmail.pl,v
retrieving revision 2.22
retrieving revision 2.23
diff -C2 -r2.22 -r2.23
*** readmail.pl	27 Oct 2002 03:10:45 -0000	2.22
--- readmail.pl	14 Nov 2002 00:40:59 -0000	2.23
***************
*** 24,28 ****
  ##
  ##---------------------------------------------------------------------------##
! ##    Copyright (C) 1996-2001	Earl Hood, mhonarc(_at_)mhonarc(_dot_)org
  ##
  ##    This program is free software; you can redistribute it and/or modify
--- 24,28 ----
  ##
  ##---------------------------------------------------------------------------##
! ##    Copyright (C) 1996-2002	Earl Hood, mhonarc(_at_)mhonarc(_dot_)org
  ##
  ##    This program is free software; you can redistribute it and/or modify
***************
*** 106,138 ****
  %MIMEDecodersSrc		= ()
      unless defined(%MIMEDecodersSrc);
- 
- ##	Default settings:
- $MIMEDecoders{"7bit"}		  = "as-is"
-     unless defined($MIMEDecoders{"7bit"});
- $MIMEDecoders{"8bit"}		  = "as-is"
-     unless defined($MIMEDecoders{"8bit"});
- $MIMEDecoders{"binary"}		  = "as-is"
-     unless defined($MIMEDecoders{"binary"});
- $MIMEDecoders{"base64"}		  = "base64::b64decode"
-     unless defined($MIMEDecoders{"base64"});
- $MIMEDecoders{"quoted-printable"} = "quoted_printable::qprdecode"
-     unless defined($MIMEDecoders{"quoted-printable"});
- $MIMEDecoders{"x-uuencode"}	  = "base64::uudecode"
-     unless defined($MIMEDecoders{"x-uuencode"});
- $MIMEDecoders{"x-uue"}     	  = "base64::uudecode"
-     unless defined($MIMEDecoders{"x-uue"});
- $MIMEDecoders{"uuencode"}  	  = "base64::uudecode"
-     unless defined($MIMEDecoders{"uuencode"});
- 
- $MIMEDecodersSrc{"base64"}	  	= "base64.pl"
-     unless defined($MIMEDecodersSrc{"base64"});
- $MIMEDecodersSrc{"quoted-printable"}	= "qprint.pl"
-     unless defined($MIMEDecodersSrc{"quoted-printable"});
- $MIMEDecodersSrc{"x-uuencode"}	 	= "base64.pl"
-     unless defined($MIMEDecodersSrc{"x-uuencode"});
- $MIMEDecodersSrc{"x-uue"}     	 	= "base64.pl"
-     unless defined($MIMEDecodersSrc{"x-uue"});
- $MIMEDecodersSrc{"uuencode"}  	 	= "base64.pl"
-     unless defined($MIMEDecodersSrc{"uuencode"});
  
  ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
--- 106,109 ----

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