[Pkg-sympa-commits] [libmime-lite-html-perl] 01/15: Imported Upstream version 1.23

Emmanuel Bouthenot kolter at moszumanska.debian.org
Wed Feb 12 21:11:40 UTC 2014


This is an automated email from the git hooks/post-receive script.

kolter pushed a commit to branch unstable
in repository libmime-lite-html-perl.

commit 3d6713f49862f55960efe42b4bc37f53a2546a0f
Author: Emmanuel Bouthenot <kolter at openics.org>
Date:   Tue Feb 11 16:01:54 2014 +0000

    Imported Upstream version 1.23
---
 COPYING                                  |   40 +
 Changes                                  |  162 ++++
 HTML.pm                                  | 1185 ++++++++++++++++++++++++++++++
 MANIFEST                                 |   95 +++
 META.yml                                 |   15 +
 Makefile.PL                              |   19 +
 README                                   |  176 +++++
 eg/example.pl                            |   16 +
 eg/example2.pl                           |   42 ++
 eg/example3.pl                           |   19 +
 t/01use.t                                |   10 +
 t/20create_image_part.t                  |   50 ++
 t/50generic.t                            |  159 ++++
 t/docs/Readme.txt                        |  101 +++
 t/docs/acceuil.js                        |  103 +++
 t/docs/img/fleur.gif                     |  Bin 0 -> 1107 bytes
 t/docs/img/sommaire.gif                  |  Bin 0 -> 675 bytes
 t/docs/index.cgi.html                    |  157 ++++
 t/docs/normal.html                       |   38 +
 t/docs/soft.css                          |   21 +
 t/docs/space_in_a_href.html              |   37 +
 t/docs/space_in_ccs_href.html            |   37 +
 t/docs/space_in_img.html                 |   40 +
 t/docs/space_in_javascript.html          |   38 +
 t/docs/space_in_javascript2.html         |   38 +
 t/ref/img/fleur.eml.cid                  |   26 +
 t/ref/img/fleur.eml.location             |   26 +
 t/ref/img/fleur.gif                      |   25 +
 t/ref/img/sommaire.eml.cid               |   18 +
 t/ref/img/sommaire.eml.location          |   18 +
 t/ref/img/sommaire.gif                   |   17 +
 t/ref/img/sommaire1.gif                  |   17 +
 t/ref/index.cgi.eml.cid                  |  313 ++++++++
 t/ref/index.cgi.eml.extern               |  262 +++++++
 t/ref/index.cgi.eml.location             |  312 ++++++++
 t/ref/index.cgi.eml2.cid                 |  296 ++++++++
 t/ref/index.cgi.eml2.extern              |  244 ++++++
 t/ref/index.cgi.eml2.location            |  295 ++++++++
 t/ref/index.cgi.eml3.cid                 |  414 +++++++++++
 t/ref/index.cgi.eml3.extern              |  363 +++++++++
 t/ref/index.cgi.eml3.location            |  413 +++++++++++
 t/ref/normal.eml.cid                     |  244 ++++++
 t/ref/normal.eml.extern                  |  214 ++++++
 t/ref/normal.eml.location                |  244 ++++++
 t/ref/normal.eml2.cid                    |  227 ++++++
 t/ref/normal.eml2.extern                 |  196 +++++
 t/ref/normal.eml2.location               |  227 ++++++
 t/ref/normal.eml3.cid                    |  345 +++++++++
 t/ref/normal.eml3.extern                 |  315 ++++++++
 t/ref/normal.eml3.location               |  345 +++++++++
 t/ref/space_in_a_href.eml.cid            |   96 +++
 t/ref/space_in_a_href.eml.extern         |   96 +++
 t/ref/space_in_a_href.eml.location       |   96 +++
 t/ref/space_in_a_href.eml2.cid           |   78 ++
 t/ref/space_in_a_href.eml2.extern        |   78 ++
 t/ref/space_in_a_href.eml2.location      |   78 ++
 t/ref/space_in_a_href.eml3.cid           |  197 +++++
 t/ref/space_in_a_href.eml3.extern        |  197 +++++
 t/ref/space_in_a_href.eml3.location      |  197 +++++
 t/ref/space_in_ccs_href.eml.cid          |   95 +++
 t/ref/space_in_ccs_href.eml.extern       |   95 +++
 t/ref/space_in_ccs_href.eml.location     |   95 +++
 t/ref/space_in_ccs_href.eml2.cid         |   77 ++
 t/ref/space_in_ccs_href.eml2.extern      |   77 ++
 t/ref/space_in_ccs_href.eml2.location    |   77 ++
 t/ref/space_in_ccs_href.eml3.cid         |  196 +++++
 t/ref/space_in_ccs_href.eml3.extern      |  196 +++++
 t/ref/space_in_ccs_href.eml3.location    |  196 +++++
 t/ref/space_in_img.eml.cid               |  247 +++++++
 t/ref/space_in_img.eml.extern            |  217 ++++++
 t/ref/space_in_img.eml.location          |  247 +++++++
 t/ref/space_in_img.eml2.cid              |  230 ++++++
 t/ref/space_in_img.eml2.extern           |  199 +++++
 t/ref/space_in_img.eml2.location         |  230 ++++++
 t/ref/space_in_img.eml3.cid              |  348 +++++++++
 t/ref/space_in_img.eml3.extern           |  318 ++++++++
 t/ref/space_in_img.eml3.location         |  348 +++++++++
 t/ref/space_in_javascript.eml.cid        |  212 ++++++
 t/ref/space_in_javascript.eml.extern     |  212 ++++++
 t/ref/space_in_javascript.eml.location   |  212 ++++++
 t/ref/space_in_javascript.eml2.cid       |  194 +++++
 t/ref/space_in_javascript.eml2.extern    |  194 +++++
 t/ref/space_in_javascript.eml2.location  |  194 +++++
 t/ref/space_in_javascript.eml3.cid       |  313 ++++++++
 t/ref/space_in_javascript.eml3.extern    |  313 ++++++++
 t/ref/space_in_javascript.eml3.location  |  313 ++++++++
 t/ref/space_in_javascript2.eml.cid       |  212 ++++++
 t/ref/space_in_javascript2.eml.extern    |  212 ++++++
 t/ref/space_in_javascript2.eml.location  |  212 ++++++
 t/ref/space_in_javascript2.eml2.cid      |  194 +++++
 t/ref/space_in_javascript2.eml2.extern   |  194 +++++
 t/ref/space_in_javascript2.eml2.location |  194 +++++
 t/ref/space_in_javascript2.eml3.cid      |  313 ++++++++
 t/ref/space_in_javascript2.eml3.extern   |  313 ++++++++
 t/ref/space_in_javascript2.eml3.location |  313 ++++++++
 95 files changed, 16929 insertions(+)

diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..fb801f6
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,40 @@
+The "MIME-Lite-HTML" Perl5 toolkit.
+
+Copyright (c) 2000 Alain BARBET.  All rights reserved.
+
+This program is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+You should have received a copy of the Perl license along with
+Perl; see the file README in Perl distribution.
+
+You should have received a copy of the GNU General Public License
+along with Perl; see the file Copying.  If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+You should have received a copy of the Artistic License
+along with Perl; see the file Artistic.
+
+			    NO WARRANTY
+
+BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
diff --git a/Changes b/Changes
new file mode 100755
index 0000000..22d2d36
--- /dev/null
+++ b/Changes
@@ -0,0 +1,162 @@
+Revision history for Perl extension MIME::Lite::HTML.
+
+1.23  2008/10/14 11:27:42  alian
+- Fix rt#36006: cid has no effect on background images
+- Fix rt#36005: include_javascript does not remove closing tag "</SCRIPT>"
+- Fix rt#29033: eliminate nested subs
+
+1.22  2006/09/09 18:05:00  alian
+- Fix rt#19656: unknown URI schemes cause rewrite to fail
+- Fix rt#17385: make test semi-panics
+- Fix rt#7841:  Text-Only Encoding Ignored
+- Fix rt#21339: no license or copyright information provided
+- Fix rt#19655: include_css is far too aggressive
+
+1.21  2004/04/15 22:59:33  alian
+- fix for 1.20 and bad ref for tests
+
+1.20  2004/04/14 21:26:51  alian
+- fix error on last version
+- add test and grow coverage
+
+1.19  2004/03/16 15:18:57  alian
+- Add Url param in new for direct call of parse & send
+- Correct a problem in parsing of html elem "background"
+- Re-indent some methods
+
+1.18  2003/08/08 09:37:42  alian
+- Fix test case and cid method
+
+1.17  2003/08/07 16:55:08  alian
+- Fix test case (hostname)
+- Update POD documentation
+
+1.16  2003/08/07 00:07:57  alian
+- Use pack for include type == cid: RFC says no '/'.
+Tks to Cl�udio Valente for report.
+- Add a __END__ statement before POD documentation.
+- Increase code coverage with help of Devel::Cover (30% to 65%).
+
+1.15  2002/10/19 17:54:32  alian
+- Correct bug with relative anchor '/'. Tks to Keith D. Zimmerman for
+report. Add some html for test.
+
+1.14  2002/08/25 17:11:34  alian
+  - Correct a dammed typo error
+
+1.13  2002/08/25 17:05:57  alian
+  - Change some regexp for be less restrictive with html tags: img a href,
+  ccs and javascript regexp has been updated. Thanks to Alberto Saez Torres
+  for patch.
+  - Add \Q\E in needed regexp for catch url with + or other. Thanks to
+  Fran�ois-Georges Cloutier for report.
+  - Add a return in fill_template to avoid in warning if no template is in
+  use. Thanks to Miguel Manso for report.
+  - Add t/* tests
+
+1.12  2002/01/07 20:18:53  alian
+  - Add replace links for frame & iframe
+  - Correct incorrect parsing in include_css for <LINK REL="SHORTCUT ICON">
+   tag. Tks to doggy at miniasp.com for idea and patch
+
+1.11  2001/12/13 22:42:33  alian
+  - Correct a bug with relative anchor
+
+1.10  2001/11/07 10:52:43  alian
+  - Add feature for get restricted url. Add LoginDetails parameter for that
+   (tks to Leon.Halford at ing-barings.com for idea)
+  - Change error in POD doc rfc2257 => rfc2557 (tks to
+   justin.zaglio at morganstanley.com)
+  - Correct warning when $url_html is undef
+
+1.9  2001/11/07 08:41:39  alian
+  - From tosh at c4.ca:  Add feature for parsing/include flash movie
+  - From Alian: Rebuild parse and create_image_part method for always use
+   create_image_part when I add a MIME part. Add comment and POD doc.
+
+1.8  2001/10/29 19:44:11 alian
+  - From Emiliano Bruni <bruni at micso.it>:
+  - Modify css link search for match file with no .css extension
+  - Now $html in parse may be empty. It will be sent a simple message
+    containing just text
+  - Correct bug in relative url replace that lost space between "a" and
+     "href"
+ - From Alian:
+  - Correct bug with empty link a href
+  - Add pod doc for win install (ppm)
+  - Update example to do a "Send this page to a friend"
+	    
+1.7  2001/10/23 21:52:54  alian
+ - Correct bug with empty background image
+
+1.6  2001/10/21 22:25:27  alian
+ - Add needed depandencies in Makefile.PL
+
+1.5  2001/07/27 12:40:44  alian
+  - Add support of custom encodings and charsets for the text and the html 
+  parts (Thanks to michalis at linuxmail.org for patch)
+
+1.4  2001/05/29 22:15:27  alian
+ - Add search and replace for the text part (tks to christopher at thedial.com)
+
+1.3  2001/05/05 22:18:10  alian
+  - Add feature of  IncludeImage key in constructor: now module can use
+  "Content-Location" field, "Content-CID field" or not include images and 
+  only make an absolute link.
+  - New construction of MIME message: module send multipart only if needed
+  - Correct an incorrect use of LWP-Agent constructor to avoid warning 
+  messages(tks to StevenBenbow at quintessa.org)
+  - Correct a strange error that occur with URI::http if i don't chomp url
+  before call it (tks to Maarten Veerman <mtveerman at mindless.com>)
+
+1.2  2001/03/20 22:35:56  alian
+ - Add POD documentation
+ - Change how final mail is build:
+  If no images are found when parse routine is used, this modules did'nt
+  use a multipart/related part, but a text/html part. Thus, we can reach
+  a max. of mail clients (See "clients tested" in documentation).
+ - Add size function
+
+1.1  2001/03/04 22:29:07  alian
+ - Correct an error with background image quote
+
+1.0  2001/03/04 22:13:19  alian
+    - Correct major problem with Eudora (See Clients tested in documentation)
+    - Build final MIME-Lite object with knowledge of RFC-2257
+    - Add some POD documentation and references
+
+0.9  2001/02/02 01:15:35  alian
+    Correct some other things with error handling (suggested by Steve Harvey
+    <sgh at vex.net>)
+
+0.8  2001/01/21 00:58:48  alian
+    Correct error function
+
+0.7  2000/12/30 20:22:27  alian
+    - Allow to send a string of text to the parse function, instead of an url
+    - Add feature to put data on the fly when image are available only on memory
+    - Put comments on print when buffer find url
+    Ideas suggested by mtveerman at mindless.com
+
+0.6   2000/12/13 11:02:58  alian
+     - Allow sup parameter for MIME-Lite in constructor
+     - Add parameter for parse url to include a text file when HTML
+    is not supported by client.
+    - Include other background than body
+
+0.5   2000/11/13 21:36:58
+     - Arg, forgot cariage return in fill_template :-(
+
+0.4   2000/11/12 18:52:56
+     - Add feature of replace word in gabarit (for newsletter by example)
+     - Include body background
+
+0.3   2000/10/26 22:55:46
+     - Add parsing for form (action and input image)
+
+0.2   2000/10/26 20:08:06
+     - Update remplacement of relative url
+
+0.01  Wed Oct 25 15:39:26 2000
+     - original version; created by h2xs 1.20 with options
+          -X -n MIME::Lite::HTML
diff --git a/HTML.pm b/HTML.pm
new file mode 100755
index 0000000..ebdf7c9
--- /dev/null
+++ b/HTML.pm
@@ -0,0 +1,1185 @@
+package MIME::Lite::HTML;
+
+# module MIME::Lite::HTML : Provide routine to transform a HTML page in 
+# a MIME::Lite mail
+# Copyright 2001 A.Barbet alian at alianwebserver.com.  All rights reserved.
+
+# $Log: HTML.pm,v $
+# Revision 1.23  2008/10/14 11:27:42  alian
+#
+# Revision 1.23  2008/10/14 11:27:42  alian
+# - Fix rt#36006: cid has no effect on background images
+# - Fix rt#36005: include_javascript does not remove closing tag "</SCRIPT>"
+# - Fix rt#29033: eliminate nested subs
+
+# Revision 1.22  2006/09/06 14:46:42  alian
+# - Fix rt#19656: unknown URI schemes cause rewrite to fail
+# - Fix rt#17385: make test semi-panics
+# - Fix rt#7841:  Text-Only Encoding Ignored
+# - Fix rt#21339: no license or copyright information provided
+# - Fix rt#19655: include_css is far too aggressive
+#
+# Revision 1.21  2004/04/15 22:59:33  alian
+# fix for 1.20 and bad ref for tests
+#
+# Revision 1.20  2004/04/14 21:26:51  alian
+# - fix error on last version
+#
+# Revision 1.19  2004/03/16 15:18:57  alian
+# - Add Url param in new for direct call of parse & send
+# - Correct a problem in parsing of html elem background
+# - Re-indent some methods
+#
+# Revision 1.18  2003/08/08 09:37:42  alian
+# Fix test case and cid method
+#
+# Revision 1.17  2003/08/07 16:55:08  alian
+# - Fix test case (hostname)
+# - Update POD documentation
+#
+# Revision 1.16  2003/08/07 00:07:57  alian
+# - Use pack for include type == cid: RFC says no '/'.
+# Tks to Cl�udio Valente for report.
+# - Add a __END__ statement before POD documentation.
+#
+# Revision 1.15  2002/10/19 17:54:32  alian
+# - Correct bug with relative anchor '/'. Tks to Keith D. Zimmerman for
+# report.
+#
+# See Changes files for older changes
+
+use LWP::UserAgent;
+use HTML::LinkExtor;
+use URI::URL;
+use MIME::Lite;
+use strict;
+use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
+
+require Exporter;
+
+ at ISA = qw(Exporter);
+ at EXPORT = qw();
+$VERSION = ('$Revision: 1.23 $ ' =~ /(\d+\.\d+)/)[0];
+
+my $LOGINDETAILS;
+
+#------------------------------------------------------------------------------
+# redefine get_basic_credentials
+#------------------------------------------------------------------------------
+{
+  package RequestAgent;
+  use vars qw(@ISA);
+  @ISA = qw(LWP::UserAgent);
+
+  sub new {
+    my $self = LWP::UserAgent::new(@_);
+    $self;
+  }
+
+  sub get_basic_credentials {	
+    my($self, $realm, $uri) = @_;
+    # Use parameter of MIME-Lite-HTML, key LoginDetails
+    if (defined $LOGINDETAILS) { return split(':', $LOGINDETAILS, 2); } 
+    # Ask user on STDIN
+    elsif (-t) {
+      my $netloc = $uri->host_port;
+      print "Enter username for $realm at $netloc: ";
+      my $user = <STDIN>;
+      chomp($user);
+      # 403 if no user given
+      return (undef, undef) unless length $user;
+      print "Password: ";
+      system("stty -echo");
+      my $password = <STDIN>;
+      system("stty echo");
+      print "\n";  # because we disabled echo
+      chomp($password);
+      return ($user, $password);
+    }
+    # Damm we got 403 with CGI (use param LoginDetails)  ...
+    else { return (undef, undef) }
+  }
+}
+
+#------------------------------------------------------------------------------
+# new
+#------------------------------------------------------------------------------
+sub new {
+  my $class = shift;
+  my $self = {};
+  bless $self, $class;
+  my %param = @_;
+  # Agent name
+  $self->{_AGENT} = new RequestAgent;
+  $self->{_AGENT}->agent("MIME-Lite-HTML $VERSION");
+  $self->{_AGENT}->from('mime-lite-html at alianwebserver.com' );
+
+  # remove javascript code or no ?
+  if ($param{'remove_jscript'}) {
+    $self->{_remove_jscript} = 1;
+  } else { $self->{_remove_jscript} = 0; }
+
+  # Set debug level
+  if ($param{'Debug'}) {
+    $self->{_DEBUG} = 1;
+    delete $param{'Debug'};
+  }
+
+  # Set Login information
+  if ($param{'LoginDetails'}) {
+    $LOGINDETAILS = $param{'LoginDetails'};
+    delete $param{'LoginDetails'};
+  }
+  # Set type of include to do
+  if ($param{'IncludeType'}) {
+    die "IncludeType must be in 'extern', 'cid' or 'location'\n" if
+      ( ($param{'IncludeType'} ne 'extern') and
+	($param{'IncludeType'} ne 'cid') and
+	($param{'IncludeType'} ne 'location'));	
+    $self->{_include} = $param{'IncludeType'};
+    delete $param{'IncludeType'};
+  } # Defaut type: use a Content-Location field
+  else {$self->{_include}='location';}
+
+  ## Added by Michalis at linuxmail.org to manipulate non-us mails
+  if ($param{'TextCharset'}) {
+    $self->{_textcharset}=$param{'TextCharset'};
+    delete $param{'TextCharset'};
+  } else { $self->{_textcharset}='iso-8859-1'; }
+  if ($param{'HTMLCharset'}) {
+    $self->{_htmlcharset}=$param{'HTMLCharset'};
+    delete $param{'HTMLCharset'};
+  } else { $self->{_htmlcharset}='iso-8859-1'; }
+  if ($param{'TextEncoding'}) {
+    $self->{_textencoding}=$param{'TextEncoding'};
+    delete $param{'TextEncoding'};
+  } else { $self->{_textencoding}='7bit'; }
+  if ($param{'HTMLEncoding'}) {
+    $self->{_htmlencoding}=$param{'HTMLEncoding'};
+    delete $param{'HTMLEncoding'};
+  } else { $self->{_htmlencoding}='quoted-printable'; }
+  ## End. Default values remain as they were initially set.
+  ## No need to change existing scripts if you send US-ASCII. 
+  ## If you DON't send us-ascii, you wouldn't be able to use 
+  ## MIME::Lite::HTML anyway :-)
+
+  # Set proxy to use to get file
+  if ($param{'Proxy'}) {
+    $self->{_AGENT}->proxy('http',$param{'Proxy'}) ;
+    print "Set proxy for http : ", $param{'Proxy'},"\n" 
+      if ($self->{_DEBUG});
+    delete $param{'Proxy'};
+  }
+
+  # Set hash to use with template
+  if ($param{'HashTemplate'}) {
+    $param{'HashTemplate'} = ref($param{'HashTemplate'}) eq "HASH" 
+      ? $param{'HashTemplate'} : %{$param{'HashTemplate'}};
+    $self->{_HASH_TEMPLATE}= $param{'HashTemplate'};
+    delete $param{'HashTemplate'};
+  }
+
+  # Ok I hope I known what I do ;-)
+  MIME::Lite->quiet(1);
+
+  # direct call of new parse & send
+  my $url;
+  if ($param{'Url'}) {
+    $url = $param{'Url'};
+    delete $param{'Url'};
+  }
+  $self->{_param} = \%param;
+  if ($url) {
+    my $m = $self->parse($url);
+    $m->send;
+  }
+
+  return $self;
+}
+
+#------------------------------------------------------------------------------
+# absUrl
+#------------------------------------------------------------------------------
+sub absUrl($$) {
+  # rt 19656 : unknown URI schemes cause rewrite to fail
+  my $rep = eval { URI::WithBase->new($_[0], $_[1])->abs; };
+  return ($rep ? $rep : $_[0]);
+}
+
+# Replace in HTML link with image with cid:key
+sub pattern_image_cid {
+  my $sel = shift;
+  return '<img '.$_[0].'src="cid:'.$sel->cid(absUrl($_[1],$_[2])).'"';
+}
+# Replace relative url for image with absolute
+sub pattern_image {
+  return '<img '.$_[0].'src="'.absUrl($_[1],$_[2]).'"';
+}
+
+sub pattern_href {
+  my ($url,$balise, $sep)=@_;
+  my $b=" $balise=\"$url\"";
+  $b.=$sep if ($sep ne '"' and $sep ne "'");
+  return $b;
+}
+
+#------------------------------------------------------------------------------
+# parse
+#------------------------------------------------------------------------------
+sub parse
+  {
+    my($self,$url_page,$url_txt,$url1)=@_;
+    my ($type, at mail,$gabarit,$gabarit_txt,$racinePage);
+
+    # Get content of $url_page with LWP
+    if ($url_page && $url_page=~/^(https?|ftp|file|nntp):\/\//)
+	{
+        print "Get ", $url_page,"\n" if $self->{_DEBUG};	
+        my $req = new HTTP::Request('GET' => $url_page);
+        my $res = $self->{_AGENT}->request($req);
+        if (!$res->is_success) 
+	    {$self->set_err("Can't fetch $url_page (".$res->message.")");}
+        else {$gabarit = $res->content;}
+        $racinePage=$url1 || $res->base;
+	}
+    else {$gabarit=$url_page;$racinePage=$url1;}
+
+    # Get content of $url_txt with LWP if needed
+    if ($url_txt)
+	{
+	  if ($url_txt=~/^(https?|ftp|file|nntp):\/\//)
+	    {
+            print "Get ", $url_txt,"\n" if $self->{_DEBUG};
+            my $req2 = new HTTP::Request('GET' => $url_txt);
+            my $res3 = $self->{_AGENT}->request($req2);
+            if (!$res3->is_success) 
+		  {$self->set_err("Can't fetch $url_txt (".$res3->message.")");}
+            else {$gabarit_txt = $res3->content;}
+	    }
+	  else {$gabarit_txt=$url_txt;}
+          }
+    goto BUILD_MESSAGE unless $gabarit;
+
+    # Get all multimedia part (img, flash) for later create a MIME part 
+    # for each of them
+    my $analyseur = HTML::LinkExtor->new;
+    $analyseur->parse($gabarit);
+    my @l = $analyseur->links;
+
+    # Include external CSS files
+    $gabarit = $self->include_css($gabarit,$racinePage);
+
+    # Include external Javascript files
+    $gabarit = $self->include_javascript($gabarit,$racinePage);
+
+    # Include form images
+    ($gabarit, at mail) = $self->input_image($gabarit,$racinePage);
+
+    # Change target action for form
+    $gabarit = $self->link_form($gabarit,$racinePage);
+
+    # Scan each part found by linkExtor
+    my (%images_read,%url_remplace);
+    foreach my $url (@l) {
+	  my $urlAbs = absUrl($$url[2],$racinePage);
+	  chomp $urlAbs; # Sometime a strange cr/lf occur
+
+	  # Replace relative href found to absolute one
+	  if ( ($$url[0] eq 'a') && ($$url[1] eq 'href') && ($$url[2]) &&
+		 (($$url[2]!~m!^http://!) && # un lien non absolu
+		  ($$url[2]!~m!^mailto:!) && # pas les mailto
+		  ($$url[2]!~m!^\#!))     && # ni les ancres
+		 (!$url_remplace{$urlAbs}) ) # ni les urls deja remplacees
+	    {
+		$gabarit=~s/\s href \s* = \s* [\"']? \Q$$url[2]\E ([\"'>])
+		           /pattern_href($urlAbs,"href",$1)/giemx;
+		print "Replace ",$$url[2]," with ",$urlAbs,"\n" 
+		  if ($self->{_DEBUG});
+		$url_remplace{$urlAbs}=1;
+	    }
+
+	  # For frame & iframe
+	  elsif ( (lc($$url[0] eq 'iframe') || lc($$url[0] eq 'frame')) &&
+		   (lc($$url[1]) eq 'src') && ($$url[2]) )
+	    {
+		$gabarit=~s/\s src \s* = \s* [\"']? \Q$$url[2]\E ([\"'>])
+		           /pattern_href($urlAbs,"src",$1)/giemx;
+		print "Replace ",$$url[2]," with ",$urlAbs,"\n"
+		  if ($self->{_DEBUG});
+		$url_remplace{$urlAbs}=1;
+	    }
+
+	  # For background images
+	  elsif ((lc($$url[1]) eq 'background') && ($$url[2])) {
+	    # Replace relative url with absolute
+	    my $v = ($self->{_include} eq 'cid') ?
+	      "cid:".$self->cid($urlAbs) : $urlAbs;
+	    $gabarit=~s/background \s* = \s* [\"']? \Q$$url[2]\E ([\"'>])
+                       /pattern_href($v,"background",$1)/giemx;
+            # Exit with extern configuration, don't include image
+            # else add part to mail
+	    if (($self->{_include} ne 'extern')&&(!$images_read{$urlAbs}))
+		 {
+		   $images_read{$urlAbs} = 1;
+		   push(@mail, $self->create_image_part($urlAbs)); 
+		 }
+	   }
+
+	  # For flash part (embed)
+	  elsif (lc($$url[0]) eq 'embed' && $$url[4]) 
+	   {
+	     # rebuild $urlAbs
+	     $urlAbs = absUrl($$url[4],$racinePage);
+	     # Replace relative url with absolute
+	     my $v = ($self->{_include} eq 'cid') ?
+		 "cid:$urlAbs" : $urlAbs;
+	     $gabarit=~s/src \s = \s [\"'] \Q$$url[4]\E ([\"'>])
+                        /pattern_href($v,"src",$1)/giemx;
+	     # Exit with extern configuration, don't include image
+	     if (($self->{_include} ne 'extern')&&(!$images_read{$urlAbs}))
+		 {
+		   $images_read{$urlAbs}=1;
+		   push(@mail, $self->create_image_part($urlAbs));
+		 }
+	   }
+
+	  # For flash part (object)
+	  # Need to add "param" to Tagset.pm in the linkElements definition:
+	  # 'param' => ['name', 'value'],
+	  # Tks to tosh at c4.ca for that
+	  elsif (lc($$url[0]) eq 'param' && lc($$url[2]) eq 'movie' 
+		 && $$url[4]) {
+	    # rebuild $urlAbs
+	    $urlAbs = absUrl($$url[4],$racinePage);
+	    # Replace relative url with absolute
+	    my $v = ($self->{_include} eq 'cid') ?
+	      "cid:".$self->cid($urlAbs) : $urlAbs;
+	    $gabarit=~s/value \s* = \s* [\"'] \Q$$url[4]\E ([\"'>])
+                       /pattern_href($v,"value",$1)/giemx;
+	    # Exit with extern configuration, don't include image
+	    if (($self->{_include} ne 'extern')&&(!$images_read{$urlAbs}))
+	      {
+		$images_read{$urlAbs}=1;
+		push(@mail, $self->create_image_part($urlAbs));
+	      }
+	  }
+
+	  # For new images create part
+	  # Exit with extern configuration, don't include image
+	  elsif ( ($self->{_include} ne 'extern') &&
+		    ((lc($$url[0]) eq 'img') || (lc($$url[0]) eq 'src')) &&
+		    (!$images_read{$urlAbs})) {
+	    $images_read{$urlAbs}=1;
+	    push(@mail, $self->create_image_part($urlAbs));
+	  }
+	}
+
+     # If cid choice, put a cid + absolute url on each link image
+     if ($self->{_include} eq 'cid') 
+       {$gabarit=~s/<img ([^<>]*) src\s*=\s*(["']?) ([^"'> ]* )(["']?)
+	           /pattern_image_cid($self,$1,$3,$racinePage)/iegx;}
+     # Else just make a absolute url
+     else {$gabarit=~s/<img ([^<>]*) src\s*=\s*(["']?)([^"'> ]*) (["']?)
+	              /pattern_image($1,$3,$racinePage)/iegx;}
+
+   BUILD_MESSAGE:
+    # Substitue value in template if needed
+    if (scalar keys %{$self->{_HASH_TEMPLATE}}!=0)
+	{
+	  $gabarit=$self->fill_template($gabarit,$self->{_HASH_TEMPLATE}) 
+	    if ($gabarit);
+	  $gabarit_txt=$self->fill_template($gabarit_txt,
+					    $self->{_HASH_TEMPLATE});
+	}
+
+    # Create MIME-Lite object
+    $self->build_mime_object($gabarit, $gabarit_txt || undef,  \@mail);
+
+    return $self->{_MAIL};
+  }
+
+#------------------------------------------------------------------------------
+# size
+#------------------------------------------------------------------------------
+sub size  {
+  my ($self)=shift;
+  return length($self->{_MAIL}->as_string);
+}
+
+#------------------------------------------------------------------------------
+# build_mime_object
+#------------------------------------------------------------------------------
+sub build_mime_object {
+  my ($self,$html,$txt,$ref_mail)=@_;
+  my ($txt_part, $part,$mail);
+  # Create part for HTML if needed
+  if ($html) {
+    my $ref = ($txt || @$ref_mail) ? {} : $self->{_param};
+    $part = new MIME::Lite(%$ref,
+			  'Type'     => 'TEXT',
+			  'Encoding' => $self->{_htmlencoding},
+			  'Data'     => $html);
+    $part->attr("content-type"=> "text/html; charset=".$self->{_htmlcharset});
+    # Remove some header for Eudora client in HTML and related part
+    $part->replace("MIME-Version" => "");
+    $part->replace('X-Mailer' =>"");
+    $part->replace('Content-Disposition' =>"");
+    # only html, no images & no txt
+    $mail = $part unless ($txt || @$ref_mail);
+  }
+
+  # Create part for text if needed
+  if ($txt) {
+    my $ref = ($html ? {} : $self->{_param}  );
+    $txt_part = new MIME::Lite (%$ref,
+			       'Type'     => 'TEXT',
+			       'Data'     => $txt,
+			       'Encoding' => $self->{_textencoding});
+    $txt_part->attr("content-type" => 
+		    "text/plain; charset=".$self->{_textcharset});
+    # Remove some header for Eudora client
+    $txt_part->replace("MIME-Version" => "");
+    $txt_part->replace("X-Mailer" => "");
+    $txt_part->replace("Content-Disposition" => "");
+    # only text, no html
+    $mail = $txt_part unless $html;
+  }
+
+  # If images and html and no text, multipart/related
+  if (@$ref_mail and !$txt) {
+    my $ref=$self->{_param};
+    $$ref{'Type'} = "multipart/related";	
+    $mail = new MIME::Lite (%$ref);
+    # Attach HTML part to related part
+    $mail->attach($part);
+    # Attach each image to related part
+    foreach (@$ref_mail) {$mail->attach($_);} # Attach list of part
+    $mail->replace("Content-Disposition" => "");
+  }
+
+  # Else if html and text and no images, multipart/alternative
+  elsif ($txt and !@$ref_mail) {
+    my $ref=$self->{_param};
+    $$ref{'Type'} = "multipart/alternative";	
+    $mail = new MIME::Lite (%$ref);
+    $mail->attach($txt_part); # Attach text part
+    $mail->attach($part); # Attach HTML part	
+  }
+
+  # Else (html, txt and images) mutilpart/alternative
+  elsif ($txt && @$ref_mail) {
+    my $ref=$self->{_param};
+    $$ref{'Type'} = "multipart/alternative";	
+    $mail = new MIME::Lite (%$ref); 
+    # Create related part
+    my $rel = new MIME::Lite ('Type'=>'multipart/related');
+    $rel->replace("Content-transfer-encoding" => "");
+    $rel->replace("MIME-Version" => "");
+    $rel->replace("X-Mailer" => "");
+    # Attach text part to alternative part
+    $mail->attach($txt_part);
+    # Attach HTML part to related part
+    $rel->attach($part);
+    # Attach each image to related part
+    foreach (@$ref_mail) {$rel->attach($_);}
+    # Attach related part to alternative part
+    $mail->attach($rel);
+  }
+  $mail->replace('X-Mailer',"MIME::Lite::HTML $VERSION");
+  $self->{_MAIL} = $mail;
+}
+
+#------------------------------------------------------------------------------
+# include_css
+#------------------------------------------------------------------------------
+sub pattern_css {
+  my ($self,$url,$milieu,$fin,$root)=@_;
+  # if not stylesheet - rt19655
+  if ($milieu!~/stylesheet/i && $fin!~/stylesheet/i) {
+    return "<link".$milieu." href=\"$url\"".$fin.">";
+  }
+  # Don't store <LINK REL="SHORTCUT ICON"> tag. Tks to doggy at miniasp.com
+  if ( $fin =~ m/shortcut/i || $milieu =~ m/shortcut/i )
+    { return "<link" . $milieu . "href='". $url . "'" . $fin .">"; }
+  # Complete url
+  my $ur = URI::URL->new($url, $root)->abs;
+  print "Include CSS file $ur\n" if $self->{_DEBUG};
+  my $res2 = $self->{_AGENT}->request(new HTTP::Request('GET' => $ur));
+  print "Ok file downloaded\n" if $self->{_DEBUG};
+  return      '<style type="text/css">'."\n".
+    '<!--'."\n".$res2->content.
+      "\n-->\n</style>\n";
+}
+
+sub include_css(\%$$) {
+  my ($self,$gabarit,$root)=@_;
+  $gabarit=~s/<link ([^<>]*?)
+                href\s*=\s*"?([^\" ]*)"?([^>]*)>
+    /$self->pattern_css($2,$1,$3,$root)/iegmx;
+
+  print "Done CSS\n" if ($self->{_DEBUG});
+  return $gabarit;
+}
+
+
+#------------------------------------------------------------------------------
+# include_javascript
+#------------------------------------------------------------------------------
+sub pattern_js {
+  my ($self,$url,$milieu,$fin,$root)=@_;
+  my $ur = URI::URL->new($url, $root)->abs;
+  print "Include Javascript file $ur\n" if $self->{_DEBUG};
+  my $res2 = $self->{_AGENT}->request(new HTTP::Request('GET' => $ur));
+  my $content = $res2->content;
+  print "Ok file downloaded\n" if $self->{_DEBUG};
+  return ($self->{_remove_jscript} ? ' ' : "\n"."<!-- $ur -->\n".
+    '<script '.$milieu.$fin.">\n".
+      '<!--'."\n".$content.
+	"\n-->\n</script>\n");
+}
+
+sub include_javascript(\%$$) {
+  my ($self,$gabarit,$root)=@_;
+  $gabarit=~s/<script([^>]*)src\s*=\s*"?([^\" ]*js)"?([^>]*)>[^<]*<\/script>
+    /$self->pattern_js($2,$1,$3,$root)/iegmx;
+  if ($self->{_remove_jscript}) {
+    $gabarit=~s/<script([^>]*)>[^<]*<\/script>//iegmx;
+  }
+  print "Done Javascript\n" if $self->{_DEBUG};
+  return $gabarit;
+}
+
+
+#------------------------------------------------------------------------------
+# input_image
+#------------------------------------------------------------------------------
+sub pattern_input_image {
+  my ($self,$deb,$url,$fin,$base,$ref_tab_mail)=@_;
+  my $ur = URI::URL->new($url, $base)->abs;
+  if ($self->{_include} ne 'extern')
+    {push(@$ref_tab_mail,$self->create_image_part($ur));}
+  if ($self->{_include} eq 'cid') 
+    {return '<input '.$deb.' src="cid:'.$ur.'"'.$fin;}
+  else {return '<input '.$deb.' src="'.$ur.'"'.$fin;}
+}
+
+sub input_image(\%$$) {
+  my ($self,$gabarit,$root)=@_;
+  my @mail;
+  $gabarit=~s/<input([^<>]*)src\s*=\s*"?([^\"'> ]*)"?([^>]*)>
+    /$self->pattern_input_image($1,$2,$3,$root,\@mail)/iegmx;
+  print "Done input image\n" if $self->{_DEBUG};
+  return ($gabarit, at mail);
+}
+
+#------------------------------------------------------------------------------
+# create_image_part
+#------------------------------------------------------------------------------
+sub create_image_part {
+  my ($self,$ur, $typ)=@_;
+  my ($type, $buff1);
+  # Create MIME type
+  if ($typ) { $type = $typ; }
+  elsif (lc($ur)=~/\.gif$/i) {$type="image/gif";}
+  elsif (lc($ur)=~/\.jpg$/i) {$type = "image/jpg";}
+  elsif (lc($ur)=~/\.png$/i) {$type = "image/png";}
+  else { $type = "application/x-shockwave-flash"; }
+
+  # Url is already in memory
+  if ($self->{_HASH_TEMPLATE}{$ur}) {
+    print "Using buffer on: ", $ur,"\n" if $self->{_DEBUG};
+    $buff1 = ref($self->{_HASH_TEMPLATE}{$ur}) eq "ARRAY" 
+      ? join "", @{$self->{_HASH_TEMPLATE}{$ur}} 
+	: $self->{_HASH_TEMPLATE}{$ur};
+    delete $self->{_HASH_TEMPLATE}{$ur};
+  } else { # Get image 
+    print "Get img ", $ur,"\n" if $self->{_DEBUG};
+    my $res2 = $self->{_AGENT}->
+      request(new HTTP::Request('GET' => $ur));
+    if (!$res2->is_success) {$self->set_err("Can't get $ur\n");}
+    $buff1=$res2->content;
+  }
+
+  # Create part
+  my $mail = new MIME::Lite( Data => $buff1, Encoding =>'base64');
+
+  $mail->attr("Content-type"=>$type);
+  # With cid configuration, add a Content-ID field
+  if ($self->{_include} eq 'cid') {
+    $mail->attr('Content-ID' =>'<'.$self->cid($ur).'>');
+  } else {  # Else (location) put a Content-Location field
+    $mail->attr('Content-Location'=>$ur);
+  }
+
+  # Remove header for Eudora client
+  $mail->replace("X-Mailer" => "");
+  $mail->replace("MIME-Version" => "");
+  $mail->replace("Content-Disposition" => "");
+  return $mail;
+}
+
+#------------------------------------------------------------------------------
+# cid
+#------------------------------------------------------------------------------
+sub cid  (\%$) {
+  my ($self, $url)=@_;
+  # rfc say: don't use '/'. So I do a pack on it.
+  # but as string can get long, I need to revert it to have
+  # difference at begin of url to avoid max size of cid
+  # I remove scheme always same in a document.
+  $url = reverse(substr($url, 7));
+  return reverse(split("",unpack("h".length($url),$url))).'@MIME-Lite-HTML-'.
+    $VERSION;
+}
+
+
+#------------------------------------------------------------------------------
+# link_form
+#------------------------------------------------------------------------------
+sub pattern_link_form  {
+  my ($self,$deb,$url,$fin,$base)=@_;
+  my $type;
+  my $ur = URI::URL->new($url, $base)->abs;
+  return '<form '.$deb.' action="'.$ur.'"'.$fin.'>';
+}
+
+sub link_form
+  {
+    my ($self,$gabarit,$root)=@_;
+    my @mail;
+     $gabarit=~s/<form([^<>]*)action="?([^\"'> ]*)"?([^>]*)>
+                /$self->pattern_link_form($1,$2,$3,$root)/iegmx;
+    print "Done form\n" if $self->{_DEBUG};
+    return $gabarit;
+  }
+
+#------------------------------------------------------------------------------
+# fill_template
+#------------------------------------------------------------------------------
+sub fill_template  {
+  my ($self,$masque,$vars)=@_;
+  return unless $masque;
+  my @buf=split(/\n/,$masque);
+  my $i=0;
+  while (my ($n,$v)=each(%$vars)) {
+    if ($v) {map {s/<\?\s\$$n\s\?>/$v/gm} @buf;}
+    else {map {s/<\?\s\$$n\s\?>//gm} @buf;}
+    $i++;
+  }
+  return join("\n", at buf);
+}
+
+#------------------------------------------------------------------------------
+# set_err
+#------------------------------------------------------------------------------
+sub set_err {
+  my($self,$error) = @_;
+  print $error,"\n" if ($self->{_DEBUG});
+  my @array;
+  if ($self->{_ERRORS}) {
+    @array = @{$self->{_ERRORS}};
+  }
+  push @array, $error;
+  $self->{_ERRORS} = \@array;
+  return 1;
+}
+
+#------------------------------------------------------------------------------
+# errstr 
+#------------------------------------------------------------------------------
+sub errstr  {
+  my($self) = @_;
+  return @{$self->{_ERRORS}} if ($self->{_ERRORS});
+  return ();
+}
+
+__END__
+
+#------------------------------------------------------------------------------
+# POD Documentation
+#------------------------------------------------------------------------------
+
+=head1 NAME
+
+MIME::Lite::HTML - Provide routine to transform a HTML page in a MIME-Lite mail
+
+=head1 SYNOPSIS
+
+  perl -MMIME::Lite::HTML -e '
+     new MIME::Lite::HTML
+         From     => "MIME-Lite\@alianwebserver.com",
+         To       => "alian\@cpan.org",
+         Url      => "http://localhost/server-status";'
+
+=head1 VERSION
+
+$Revision: 1.23 $
+
+=head1 DESCRIPTION
+
+This module is a Perl mail client interface for sending message that 
+support HTML format and build them for you..
+This module provide routine to transform a HTML page in MIME::Lite mail.
+So you need this module to use MIME-Lite-HTML possibilities
+
+=head2 What's happen ?
+
+The job done is:
+
+=over
+
+=item *
+
+Get the file (LWP) if needed
+
+=item *
+
+Parse page to find include images (gif, jpg, flash)
+
+=item *
+
+Attach them to mail with adequat header if asked (default)
+
+=item *
+
+Include external CSS,Javascript file
+
+=item *
+
+Replace relative url with absolute one
+
+=item *
+
+Build the final MIME-Lite object with each part found
+
+=back
+
+
+
+=head2 Usage
+
+Did you alread see link like "Send this page to a friend" ?. With this module,
+you can do script that to this in 3 lines.
+
+It can be used too in a HTML newsletter. You make a classic HTML page,
+and give just url to MIME::Lite::HTML.
+
+=head2 Construction
+
+MIME-Lite-HTML use a MIME-Lite object, and RFC2557 construction:
+
+If images and text are present, construction use is:
+
+  --> multipart/alternative
+  ------> text/plain
+  ------> multipart/related
+  -------------> text/html
+  -------------> each images
+
+If no images but text is present, this is that:
+
+  ---> multipart/alternative
+  -------> text/plain if present
+  -------> text/html
+
+If images but no text, this is:
+
+  ---> multipart/related
+  -------> text/html
+  -------> each images
+
+If no images and no text, this is:
+
+  ---> text/html
+
+
+
+=head2 Documentation
+
+Additionnal documentation can be found here:
+
+=over
+
+=item *
+
+MIME-lite module
+
+=item *
+
+RFC 822, RFC 1521, RFC 1522 and specially RFC 2557 (MIME Encapsulation
+of Aggregate Documents, such as HTML)
+
+=back
+
+
+
+=head2 Clients tested
+
+HTML in mail is not full supported so this module can't work with all email
+clients. If some client recognize HTML, they didn't support images include in
+HTML. So in fact, they recognize multipart/relative but not multipart/related.
+
+=over
+
+=item Netscape Messager (Linux-Windows)
+
+100% ok
+
+=item Outlook Express (Windows-Mac)
+
+100% ok. Mac work only with Content-Location header. Thx to Steve Benbow for
+give mr this feedback and for his test.
+
+=item Eudora (Windows)
+
+If this module just send HTML and text, (without images), 100% ok.
+
+With images, Eudora didn't recognize multipart/related part as describe in
+RFC 2557 even if he can read his own HTML mail. So if images are present in 
+HTML part, text and HTML part will be displayed both, text part in first. 
+Two additional headers will be displayed in HTML part too in this case. 
+Version 1.0 of this module correct major problem of headers displayed 
+with image include in HTML part.
+
+=item KMail (Linux)
+
+If this module just send HTML and text, (without images), 100% ok.
+
+In other case, Kmail didn't support image include in HTML. So if you set in 
+KMail "Prefer HTML to text", it display HTML with images broken. Otherwise, 
+it display text part.
+
+=item Pegasus (Windows)
+
+If this module just send HTML and text, (without images), 100% ok.
+
+Pegasus didn't support images in HTML. When it find a multipart/related 
+message, it ignore it, and display text part.
+
+=back
+
+If you find others mail client who support (or not support) MIME-Lite-HTML
+module, give me some feedback ! If you want be sure that your mail can be 
+read by maximum of people, (so not only OE and Netscape), don't include 
+images in your mail, and use a text buffer too. If multipart/related mail 
+is not recognize, multipart/alternative can be read by the most of mail client.
+
+
+
+=head2 Install on WinX with ActiveState / PPM
+
+Just do in DOS "shell":
+
+  c:\ ppm
+  > set repository alian http://www.alianwebserver.com/perl/CPAN
+  > install MIME-Lite-HTML
+  > quit
+
+
+
+=head2 How know when next release will be ?
+
+Subscribe on http://www.alianwebserver.com/cgi-bin/news_mlh.cgi
+
+
+
+=head1 Public Interface
+
+=over
+
+=item new(%hash)
+
+Create a new instance of MIME::Lite::HTML.
+
+The hash can have this key : [Url], [Proxy], [Debug], [IncludeType],
+ [HashTemplate], [LoginDetails], [TextCharset], [HTMLCharset],
+ [TextEncoding], [HTMLEncoding], [remove_jscript]
+
+=over
+
+=item Url
+
+... is url to parse and send. If this param is found, call of parse routine
+and send of mail is done. Else you must use parse routine of MIME::Lite::HTML
+and send of MIME::Lite.
+
+=item Proxy
+
+... is url of proxy to use.
+
+  Eg: Proxy => 'http://192.168.100.166:8080'
+
+=item remove_jscript
+
+if set, remove all script code from html source
+
+  Eg: remove_jscript => 1
+
+=item Debug
+
+... is trace to stdout during parsing.
+
+  Eg: Debug => 1
+
+=item IncludeType
+
+... is method to use when finding images:
+
+=over
+
+=item location
+
+Default method is embed them in mail whith 'Content-Location' header. 
+
+=item cid
+
+You use a 'Content-CID' header.
+
+=item extern
+
+Images are not embed, relative url are just replace with absolute, 
+so images are fetch when user read mail. (Server must be reachable !)
+
+=back
+
+=item $hash{'HashTemplate'} 
+
+... is a reference to a hash. If present, MIME::Lite::HTML 
+will substitute <? $name ?> with $hash{'HashTemplate'}{'name'} when parse url 
+to send. $hash{'HashTemplate'} can be used too for include data for subelement.
+Eg:
+
+  $hash{'HashTemplate'}{'http://www.al.com/images/sommaire.gif'}=\@data;
+
+or 
+
+  $hash{'HashTemplate'}{'http://www.al.com/script.js'}="alert("Hello world");;
+
+When module find the image http://www.alianwebserver.com/images/sommaire.gif 
+in buffer, it don't get image with LWP but use data found in 
+$hash{'HashTemplate'}. (See eg/example2.pl)
+
+=item LoginDetails
+
+... is the couple user:password for use with restricted url. 
+
+  Eg: LoginDetails => 'my_user:my_password'
+
+=item TextCharset
+
+... is the character set to use for the text part.
+
+  Eg: TextCharset => 'iso-8859-7'
+
+for Greek. If none specified, the default is used (iso-8859-1).
+
+=item HTMLCharset
+
+... is the character set to use for the html part. 
+
+  Eg:  HTMLCharset => 'iso-8859-7'
+
+for Greek. If none specified, the default is used (iso-8859-1).
+Take care, as that option does NOT change the character
+set of the HTML page, it only changes the character set of the mime part.
+
+=item TextEncoding 
+
+... is the Encoding to be used for the text part (if such a part 
+exists). If none specified, the default is used (7bit).
+
+  Eg: TextEncoding => 'base64'
+
+=item HTMLEncoding 
+
+... is the Encoding to be used for the html part. If none specified, the 
+default is used (quoted-printable).
+
+  Eg: HTMLEncoding => 'base64'.
+
+=back
+
+Others keys are use with MIME::Lite constructor.
+
+This MIME-Lite keys are: Bcc, Encrypted, Received, Sender, Cc, From,
+References, Subject, Comments, Keywords, Reply-To To, Content-*,
+Message-ID,Resent-*, X-*,Date, MIME-Version, Return-Path,
+Organization
+
+
+
+=item parse($html, [$url_txt], [$url_base])
+
+Subroutine used for created HTML mail with MIME-Lite
+
+Parameters:
+
+=over
+
+=item $html
+
+Url of HTML file to send, can be a local file. If $url is not an
+url (http or https or ftp or file or nntp), $url is used as a buffer.
+Example : 
+
+  http://www.alianwebserver.com
+  file://c|/tmp/index.html
+  <img src=toto.gif>
+
+=item $url_txt
+
+Url of text part to send for person who doesn't support HTML mail.
+As $html, $url_txt can be a simple buffer.
+
+=item $url_base
+
+$url_base is used if $html is a buffer, for get element found in HTML buffer.
+
+=back
+
+Return the MIME::Lite part to send
+
+=item size()
+
+Display size of mail in characters (so octets) that will be send.
+(So use it *after* parse method). Use this method for control
+size of mail send, I personnaly hate receive 500k by mail.
+I pay for a 33k modem :-(
+
+=back
+
+=head1 Private methods
+
+=over
+
+=item build_mime_object($html,[$txt],[@mail])
+
+(private)
+
+Build the final MIME-Lite object to send with each part read before
+
+=over
+
+=item $html
+
+Buffer of HTML part
+
+=item $txt
+
+Buffer of text part
+
+=item @mail
+
+List of images attached to HTML part. Each item is a MIME-Lite object.
+
+=back
+
+See "Construction" in "Description" for know how MIME-Lite object is build.
+
+=item create_image_part($url)
+
+(private)
+
+Fetch if needed $url, and create a MIME part for it.
+
+=item include_css($gabarit,$root)
+
+(private)
+
+Search in HTML buffer ($gabarit) to remplace call to extern CSS file
+with his content. $root is original absolute url where css file will
+be found.
+
+=item include_javascript($gabarit,$root)
+
+(private)
+
+Search in HTML buffer ($gabarit) to remplace call to extern javascript file
+with his content. $root is original absolute url where javascript file will
+be found.
+
+=item input_image($gabarit,$root)
+
+(private)
+
+Search in HTML buffer ($gabarit) to remplace input form image with his cid
+
+Return final buffer and list of MIME::Lite part
+
+=item link_form($gabarit,$root)
+
+(private)
+
+Replace link to formulaire with absolute link
+
+=item fill_template($masque,$vars)
+
+=over
+
+=item $masque
+
+Path of template
+
+=item $vars
+
+hash ref with keys/val to substitue
+
+=back
+
+Give template with remplaced variables
+Ex: if $$vars{age}=12, and $masque have
+
+  J'ai <? $age ?> ans,
+
+this function give:
+
+  J'ai 12 ans,
+
+=back
+
+=head1 Error Handling
+
+The set_err routine is used privately. You can ask for an array of all the 
+errors which occured inside the parse routine by calling:
+
+ at errors = $mailHTML->errstr;
+
+If no errors where found, it'll return undef.
+
+=head1 CGI Example
+
+  #!/usr/bin/perl -w 
+  # A cgi program that do "Mail this page to a friend";
+  # Call this script like this :
+  # script.cgi?email=myfriend at isp.com&url=http://www.go.com
+  use strict;
+  use CGI qw/:standard/;
+  use CGI::Carp qw/fatalsToBrowser/;
+  use MIME::Lite::HTML;
+  
+  my $mailHTML = new MIME::Lite::HTML
+     From     => 'MIME-Lite at alianwebserver.com',
+     To       => param('email'),
+     Subject => 'Your url: '.param('url');
+  
+  my $MIMEmail = $mailHTML->parse(param('url'));
+  $MIMEmail->send; # or for win user : $mail->send_by_smtp('smtp.fai.com');
+  print header,"Mail envoye (", param('url'), " to ", param('email'),")<br>\n";
+
+=head1 TERMS AND CONDITIONS
+
+  Copyright (c) 2000 by Alain BARBET alian (at) cpan.org
+
+All rights reserved.  This program is free software; you can
+redistribute it and/or modify it under the same terms as Perl
+itself.
+
+This software comes with B<NO WARRANTY> of any kind.
+See the COPYING file in the distribution for details.
+
+=head1 AUTHOR
+
+Alain BARBET alian at cpan.org , see file Changes for helpers.
+
+=cut
+
diff --git a/MANIFEST b/MANIFEST
new file mode 100644
index 0000000..e8623b0
--- /dev/null
+++ b/MANIFEST
@@ -0,0 +1,95 @@
+Changes
+HTML.pm
+MANIFEST
+Makefile.PL
+README
+COPYING
+eg/example.pl
+eg/example2.pl
+eg/example3.pl
+t/01use.t
+t/20create_image_part.t
+t/50generic.t
+t/docs/Readme.txt
+t/docs/acceuil.js
+t/docs/img/fleur.gif
+t/docs/img/sommaire.gif
+t/docs/index.cgi.html
+t/docs/normal.html
+t/docs/soft.css
+t/docs/space_in_a_href.html
+t/docs/space_in_ccs_href.html
+t/docs/space_in_img.html
+t/docs/space_in_javascript.html
+t/docs/space_in_javascript2.html
+t/ref/img/fleur.eml.cid
+t/ref/img/fleur.eml.location
+t/ref/img/fleur.gif
+t/ref/img/sommaire.eml.cid
+t/ref/img/sommaire.eml.location
+t/ref/img/sommaire.gif
+t/ref/img/sommaire1.gif
+t/ref/index.cgi.eml.cid
+t/ref/index.cgi.eml.extern
+t/ref/index.cgi.eml.location
+t/ref/index.cgi.eml2.cid
+t/ref/index.cgi.eml2.extern
+t/ref/index.cgi.eml2.location
+t/ref/index.cgi.eml3.cid
+t/ref/index.cgi.eml3.extern
+t/ref/index.cgi.eml3.location
+t/ref/normal.eml.cid
+t/ref/normal.eml.extern
+t/ref/normal.eml.location
+t/ref/normal.eml2.cid
+t/ref/normal.eml2.extern
+t/ref/normal.eml2.location
+t/ref/normal.eml3.cid
+t/ref/normal.eml3.extern
+t/ref/normal.eml3.location
+t/ref/space_in_a_href.eml.cid
+t/ref/space_in_a_href.eml.extern
+t/ref/space_in_a_href.eml.location
+t/ref/space_in_a_href.eml2.cid
+t/ref/space_in_a_href.eml2.extern
+t/ref/space_in_a_href.eml2.location
+t/ref/space_in_a_href.eml3.cid
+t/ref/space_in_a_href.eml3.extern
+t/ref/space_in_a_href.eml3.location
+t/ref/space_in_ccs_href.eml.cid
+t/ref/space_in_ccs_href.eml.extern
+t/ref/space_in_ccs_href.eml.location
+t/ref/space_in_ccs_href.eml2.cid
+t/ref/space_in_ccs_href.eml2.extern
+t/ref/space_in_ccs_href.eml2.location
+t/ref/space_in_ccs_href.eml3.cid
+t/ref/space_in_ccs_href.eml3.extern
+t/ref/space_in_ccs_href.eml3.location
+t/ref/space_in_img.eml.cid
+t/ref/space_in_img.eml.extern
+t/ref/space_in_img.eml.location
+t/ref/space_in_img.eml2.cid
+t/ref/space_in_img.eml2.extern
+t/ref/space_in_img.eml2.location
+t/ref/space_in_img.eml3.cid
+t/ref/space_in_img.eml3.extern
+t/ref/space_in_img.eml3.location
+t/ref/space_in_javascript.eml.cid
+t/ref/space_in_javascript.eml.extern
+t/ref/space_in_javascript.eml.location
+t/ref/space_in_javascript.eml2.cid
+t/ref/space_in_javascript.eml2.extern
+t/ref/space_in_javascript.eml2.location
+t/ref/space_in_javascript.eml3.cid
+t/ref/space_in_javascript.eml3.extern
+t/ref/space_in_javascript.eml3.location
+t/ref/space_in_javascript2.eml.cid
+t/ref/space_in_javascript2.eml.extern
+t/ref/space_in_javascript2.eml.location
+t/ref/space_in_javascript2.eml2.cid
+t/ref/space_in_javascript2.eml2.extern
+t/ref/space_in_javascript2.eml2.location
+t/ref/space_in_javascript2.eml3.cid
+t/ref/space_in_javascript2.eml3.extern
+t/ref/space_in_javascript2.eml3.location
+META.yml                                 Module meta-data (added by MakeMaker)
diff --git a/META.yml b/META.yml
new file mode 100644
index 0000000..f65fcc7
--- /dev/null
+++ b/META.yml
@@ -0,0 +1,15 @@
+# http://module-build.sourceforge.net/META-spec.html
+#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
+name:         MIME-Lite-HTML
+version:      1.23
+version_from: HTML.pm
+installdirs:  site
+requires:
+    HTML::LinkExtor:               0
+    LWP::UserAgent:                0
+    MIME::Lite:                    1
+    Test::More:                    0
+    URI::URL:                      0
+
+distribution_type: module
+generated_by: ExtUtils::MakeMaker version 6.30
diff --git a/Makefile.PL b/Makefile.PL
new file mode 100755
index 0000000..1e0765d
--- /dev/null
+++ b/Makefile.PL
@@ -0,0 +1,19 @@
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+    'NAME'		=> 'MIME::Lite::HTML',
+    'VERSION_FROM'	=> 'HTML.pm', # finds $VERSION
+    'PREREQ_PM'		=> {	
+	    			MIME::Lite      => 1.0,
+				LWP::UserAgent  => 0,
+				HTML::LinkExtor => 0,
+				URI::URL	=> 0,
+				Test::More	=> 0
+			}, # e.g., Module::Name => 1.1
+     ($] ge '5.005') ? 
+		  (
+		   'AUTHOR' => 'Alain BARBET (alian at cpan.org)',
+		   'ABSTRACT' => 'Provide routine to transform a HTML page '.
+		                 'in a MIME-Lite mail') : ()
+		 );
diff --git a/README b/README
new file mode 100755
index 0000000..e815c38
--- /dev/null
+++ b/README
@@ -0,0 +1,176 @@
+WHAT IS THIS ?
+
+This is MIME::Lite::HTML, a module which provide routine 
+to transform a HTML page in a MIME::Lite mail
+
+HOW DO I INSTALL IT ?
+
+To install this module, cd to the directory that contains
+this README file and type the following:
+
+   perl Makefile.PL
+   make
+   make test
+   make install
+
+If you can't do that, you can put HTML.pm file in
+directory $root/MIME/Lite/HTML.pm and then put use lib
+$root in your program (make same thing if you haven't MIME-Lite
+module).
+So it give:
+$root/MIME/Lite/HTML.pm
+$root/MIME/Lite.pm
+
+and in your script:
+
+#!/usr/bin/perl
+use lib '/home/alian/mylibperl';
+use MIME::Lite;
+use MIME::Lite::HTML;
+
+REQUIREMENT ?
+
+libnet, MIME::Lite
+
+DOCUMENTATION ?
+
+You'll find documentation in the file HTML.pm in POD format
+See too the eg directory
+
+When you install MIME::Lite::HTML, the MakeMaker program
+will automatically install the manual pages for you
+(on Unix systems, type "man MIME::Lite::HTML").
+
+Here an extract of POD documentation:
+
+NAME
+    MIME::Lite::HTML - Provide routine to transform a HTML page in a
+    MIME-Lite mail
+
+SYNOPSIS
+      use MIME::Lite::HTML;
+
+      my $mailHTML = new MIME::Lite::HTML
+         From     => 'MIME-Lite at alianwebserver.com',
+         To       => 'alian at saturne',
+         Subject => 'Mail in HTML with images';
+
+      $MIMEmail = $mailHTML->parse('http://www.alianwebserver.com');
+      $MIMEmail->send; # or for win user : $mail->send_by_smtp('smtp.fai.com');
+
+DESCRIPTION
+    This module is a Perl mail client interface for sending message that
+    support HTML format and build them for you.. This module provide routine
+    to transform a HTML page in MIME::Lite mail. So you need this module to
+    use MIME-Lite-HTML possibilities
+
+  What's happen ?
+
+    The job done is:
+
+    *   Get the file (LWP) if needed
+
+    *   Parse page to find include images
+
+    *   Attach them to mail with adequat header if asked (default)
+
+    *   Include external CSS,Javascript file
+
+    *   Replace relative url with absolute one
+
+    *   Build the final MIME-Lite object with each part found
+
+  Usage
+
+    Did you alread see link like "Send this page to a friend" ?. With this
+    module, you can do script that to this in 3 lines.
+
+    It can be used too in a HTML newsletter. You make a classic HTML page,
+    and give just url to MIME::Lite::HTML.
+
+  Construction
+
+    MIME-Lite-HTML use a MIME-Lite object, and RFC2257 construction:
+
+    If images and text are present, construction use is:
+
+      --> multipart/alternative
+      ------> text/plain
+      ------> multipart/related
+      -------------> text/html
+      -------------> each images
+
+    If no images but text is present, this is that:
+
+      ---> multipart/alternative
+      -------> text/plain if present
+      -------> text/html
+
+    If images but no text, this is:
+
+      ---> multipart/related
+      -------> text/html
+      -------> each images
+
+    If no images and no text, this is:
+
+      ---> text/html
+
+  Documentation
+
+    Additionnal documentation can be found here:
+
+    *   MIME-lite module
+
+    *   RFC 822, RFC 1521, RFC 1522 and specially RFC 2257 (MIME
+        Encapsulation of Aggregate Documents, such as HTML)
+
+  Clients tested
+
+    HTML in mail is not full supported so this module can't work with all
+    email clients. If some client recognize HTML, they didn't support images
+    include in HTML. So in fact, they recognize multipart/relative but not
+    multipart/related.
+
+    Netscape Messager (Linux-Windows)
+        100% ok
+
+    Outlook Express (Windows)
+        100% ok
+
+    Eudora (Windows)
+        If this module just send HTML and text, (without images), 100% ok.
+
+        With images, Eudora didn't recognize multipart/related part as
+        describe in RFC 2257 even if he can read his own HTML mail. So if
+        images are present in HTML part, text and HTML part will be
+        displayed both, text part in first. Two additional headers will be
+        displayed in HTML part too in this case. Version 1.0 of this module
+        correct major problem of headers displayed with image include in
+        HTML part.
+
+    KMail (Linux)
+        If this module just send HTML and text, (without images), 100% ok.
+
+        In other case, Kmail didn't support image include in HTML. So if you
+        set in KMail "Prefer HTML to text", it display HTML with images
+        broken. Otherwise, it display text part.
+
+    Pegasus (Windows)
+        If this module just send HTML and text, (without images), 100% ok.
+
+        Pegasus didn't support images in HTML. When it find a
+        multipart/related message, it ignore it, and display text part.
+
+    If you find others mail client who support (or not support)
+    MIME-Lite-HTML module, give me some feedback ! If you want be sure that
+    your mail can be read by maximum of people, (so not only OE and
+    Netscape), don't include images in your mail, and use a text buffer too.
+    If multipart/related mail is not recognize, multipart/alternative can be
+    read by the most of mail client.
+
+
+Have fun, and let me know how it turns out!
+
+Alain BARBET
+alian at alianwebserver.com
diff --git a/eg/example.pl b/eg/example.pl
new file mode 100755
index 0000000..2694982
--- /dev/null
+++ b/eg/example.pl
@@ -0,0 +1,16 @@
+#!/usr/bin/env perl
+
+  use MIME::Lite;
+  use MIME::Lite::HTML;
+
+  my $mailHTML = new MIME::Lite::HTML
+     From     => 'alian at saturne.alianet',
+     To       => 'alian at jupiter.alianet',
+     Subject  => 'Mail in HTML with images',
+     Debug    => 1,
+     IncludeType => 'cid';
+
+  $MIMEmail = $mailHTML->parse('http://alianwebserver.alianet',"et alors ?");
+  print "Taille:",$mailHTML->size(),"\n"; 
+  $MIMEmail->send; # or for win user : $mail->send_by_smtp('smtp.fai.com');
+  # print $MIMEmail->as_string;
diff --git a/eg/example2.pl b/eg/example2.pl
new file mode 100755
index 0000000..3c3e190
--- /dev/null
+++ b/eg/example2.pl
@@ -0,0 +1,42 @@
+#!/usr/bin/perl
+
+use CGI;
+use CGI::Carp qw(fatalsToBrowser);
+use strict;
+use MIME::Lite;
+use MIME::Lite::HTML;
+
+my $cgi = new CGI;
+
+print $cgi->header;
+
+open(FILE, "titlebar.gif");
+binmode FILE;
+my @data = <FILE>;
+close(FILE);
+my %hash;
+$hash{"http://localhost/testing/titlebar.gif"} = \@data;
+$hash{'test'} = "test";
+
+  my $msg = new MIME::Lite::HTML (
+       From     => 'MIME-Lite at alianwebserver.com',
+     To       => 'alian at jupiter',
+     Debug => 1,
+     HashTemplate => \%hash,
+     Subject => 'Mail in HTML with images',
+);
+
+     my $html = qq~<b>This is a <? \$test ?></b>:<p><img src="http://localhost/testing/titlebar.gif"><br>Hoi!   ~;
+     #$html = "http://jupiter";
+     my   $txt = qq~     Testing!!     ~;
+
+my $MMail = $msg->parse($html, $txt);
+#$MMail->send;
+#$MMail->send_by_smtp('jupiter');
+#exit;
+open(EMAIL, ">email.eml");
+print EMAIL $MMail->as_string;
+close(EMAIL);
+
+print "Done!";
+print join "<br>", $msg->errstr;
\ No newline at end of file
diff --git a/eg/example3.pl b/eg/example3.pl
new file mode 100644
index 0000000..627a40a
--- /dev/null
+++ b/eg/example3.pl
@@ -0,0 +1,19 @@
+#!/usr/bin/perl -w 
+#  # A cgi program that do "Mail this page to a friend";
+#  # Call this script like this :
+#  # script.cgi?email=myfriend at isp.com&url=http://www.go.com
+use strict;
+use CGI qw/:standard/;
+use CGI::Carp qw/fatalsToBrowser/;
+use MIME::Lite::HTML;
+
+my $mailHTML = new MIME::Lite::HTML
+  From     => 'MIME-Lite at alianwebserver.com',
+  To       => param('email'),
+  Subject  => 'Your url: '.param('url'), 
+  Debug    => 1;
+
+
+my $MIMEmail = $mailHTML->parse(param('url'));
+$MIMEmail->send; # or for win user : $mail->send_by_smtp('smtp.fai.com');
+print header,"Mail envoye (", param('url'), " to ", param('email'),")<br>\n";
diff --git a/t/01use.t b/t/01use.t
new file mode 100644
index 0000000..6c26b4d
--- /dev/null
+++ b/t/01use.t
@@ -0,0 +1,10 @@
+#!/usr/bin/env perl -w
+use strict;
+use Test;
+BEGIN { plan tests => 1 }
+
+use MIME::Lite::HTML; ok(1);
+exit;
+__END__
+
+
diff --git a/t/20create_image_part.t b/t/20create_image_part.t
new file mode 100644
index 0000000..0df935f
--- /dev/null
+++ b/t/20create_image_part.t
@@ -0,0 +1,50 @@
+#!/usr/bin/env perl -w
+
+use strict;
+use Test::More;
+use MIME::Lite;
+use MIME::Lite::HTML;
+use Cwd;
+
+# For create ref file, use perl -Iblib/lib t/20create_image_part.t 1
+
+my $t = "/var/tmp/mime-lite-html-tests";
+my $p = cwd;
+my $o = (system("ln -s $p/t $t")==0);
+my @files_to_test = glob("$t/docs/img/*.gif");
+plan tests => ($#files_to_test+1)*2;
+
+foreach my $it ('cid', 'location') {
+  foreach my $f (@files_to_test) {
+    my $ref = $f;
+    $ref=~s/\.gif/\.eml\.$it/; $ref=~s/docs\//ref\//;
+    my $mailHTML = new MIME::Lite::HTML
+      (
+       From     => 'MIME-Lite at alianwebserver.com',
+       To       => 'MIME-Lite at alianwebserver.com',
+       Subject  => 'Mail in HTML with images',
+       IncludeType => $it,
+       Debug    => 0
+      );
+    my $url_file = "file://$f";
+    my $rep = $mailHTML->create_image_part($url_file);
+    $rep = $rep->as_string;
+    $rep =~s/^Date: .*$//gm;
+    if (!$ARGV[0]) {
+      open(PROD,">$f.created_by_test")
+	or die "Can't create $f.created_by_test:$!";
+      print PROD $rep;
+      close(PROD);
+      my $r = `diff $ref $f.created_by_test`;
+      is($r, "", $ref);
+      unlink("$f.created_by_test");
+    } # For create .ref file
+    else {
+      print "Create $ref\n";
+      open(F,">$ref") or die "Can't create $ref:$!\n";
+      print F $rep;
+      close(F);
+    }
+  }
+}
+unlink($t);
diff --git a/t/50generic.t b/t/50generic.t
new file mode 100644
index 0000000..5ba7895
--- /dev/null
+++ b/t/50generic.t
@@ -0,0 +1,159 @@
+#!/usr/bin/env perl -w
+
+use strict;
+use Test::More;
+use MIME::Lite;
+use MIME::Lite::HTML;
+use Cwd;
+{
+  require URI::URL;
+  URI::URL->strict(1);
+}
+
+
+# For create ref file, use perl -Iblib/lib t/50generic.t 1
+
+my $t = "/var/tmp/mime-lite-html-tests";
+my $p = cwd;
+
+my $o=(system("ln -s $p/t $t")==0);
+my @files_to_test = glob("$t/docs/*.html");
+if ($o) {  plan tests => (($#files_to_test+1)* 9 * 3)+1; }
+else { plan skip_all => "Error on link ".$p."/t!"; }
+
+foreach my $it ('cid', 'location', 'extern') {
+  foreach my $f (@files_to_test) {
+    my $ref = $f;
+    $ref=~s/\.html/\.eml\.$it/; $ref=~s/docs\//ref\//;
+    my $mailHTML = new MIME::Lite::HTML
+      (
+       From     => 'MIME-Lite at alianwebserver.com',
+       To       => 'MIME-Lite at alianwebserver.com',
+       Subject  => 'Mail in HTML with images',
+       Debug    => 1,
+       IncludeType => $it
+      );
+    my $url_file = "file://$f";
+    print $url_file,"\n";
+    my $rep = $mailHTML->parse($url_file, "A text message");
+    $rep = $rep->as_string;
+    $rep =~s/^Date: .*$//gm;
+    my @bound;
+    while ($rep=~m!boundary="(.*)"!gm) { push(@bound, $1);  }
+    foreach (@bound) { $rep=~s/$_/alian-mime-lite-html/g; }
+
+    if (!$ARGV[0]) {
+      open(PROD,">$f.created_by_test")
+	or die "Can't create $f.created_by_test:$!";
+      print PROD $rep;
+      close(PROD);
+    my $r = `diff $ref $f.created_by_test`;
+      cmp_ok($mailHTML->size, ">", (stat($ref))[7], "Same size");
+      cmp_ok($mailHTML->size*0.945, "<", (stat($ref))[7], "Same size");
+      is($r, "", $ref);
+      unlink("$f.created_by_test");
+    }
+    # for create ref file
+    elsif ($ARGV[0]) {
+      ok(open(F,">$ref"),"Create $ref");
+      print F $rep;
+      close(F);
+    }
+  }
+}
+
+foreach my $it ('cid', 'location', 'extern') {
+  foreach my $f (@files_to_test) {
+    my $ref = $f;
+    $ref=~s/\.html/\.eml2\.$it/; $ref=~s/docs\//ref\//;
+    my $mailHTML = new MIME::Lite::HTML
+      (
+       From     => 'MIME-Lite at alianwebserver.com',
+       To       => 'MIME-Lite at alianwebserver.com',
+       Subject  => 'Mail in HTML with images',
+       Debug    => 1,
+       IncludeType => $it
+      );
+    my $url_file = "file://$f";
+    print $url_file,"\n";
+    my $rep = $mailHTML->parse($url_file);
+    $rep = $rep->as_string;
+    $rep =~s/^Date: .*$//gm;
+    my @bound;
+    while ($rep=~m!boundary="(.*)"!gm) { push(@bound, $1);  }
+    foreach (@bound) { $rep=~s/$_/alian-mime-lite-html/g; }
+
+    if (!$ARGV[0]) {
+      open(PROD,">$f.created_by_test")
+	or die "Can't create $f.created_by_test:$!";
+      print PROD $rep;
+      close(PROD);
+    my $r = `diff $ref $f.created_by_test`;
+      cmp_ok($mailHTML->size, ">", (stat($ref))[7], "Same size");
+      cmp_ok($mailHTML->size*0.945, "<", (stat($ref))[7], "Same size");
+      is($r, "", $ref);
+      unlink("$f.created_by_test");
+    }
+    # for create ref file
+    elsif ($ARGV[0]) {
+      ok(open(F,">$ref"),"Create $ref");
+      print F $rep;
+      close(F);
+    }
+  }
+}
+
+foreach my $it ('cid', 'location', 'extern') {
+  foreach my $f (@files_to_test) {
+    my $ref = $f;
+    $ref=~s/\.html/\.eml3\.$it/; $ref=~s/docs\//ref\//;
+    my $mailHTML = new MIME::Lite::HTML
+      (
+       From     => 'MIME-Lite at alianwebserver.com',
+       To       => 'MIME-Lite at alianwebserver.com',
+       Subject  => 'Mail in HTML with images',
+       Debug    => 1,
+       IncludeType => $it
+      );
+    my $url_file = "file://$f";
+    print $url_file,"\n";
+    my $rep = $mailHTML->parse($url_file, 'file://'.$t.'/docs/Readme.txt');
+#    print $mailHTML->errstr;
+    $rep = $rep->as_string;
+    $rep =~s/^Date: .*$//gm;
+    my @bound;
+    while ($rep=~m!boundary="(.*)"!gm) { push(@bound, $1);  }
+    foreach (@bound) { $rep=~s/$_/alian-mime-lite-html/g; }
+
+    if (!$ARGV[0]) {
+      open(PROD,">$f.created_by_test")
+	or die "Can't create $f.created_by_test:$!";
+      print PROD $rep;
+      close(PROD);
+    my $r = `diff $ref $f.created_by_test`;
+      cmp_ok($mailHTML->size, ">", (stat($ref))[7], "Same size");
+      cmp_ok($mailHTML->size*0.945, "<", (stat($ref))[7], "Same size");
+      is($r, "", $ref);
+      unlink("$f.created_by_test");
+    }
+    # for create ref file
+    elsif ($ARGV[0]) {
+      ok(open(F,">$ref"),"Create $ref");
+      print F $rep;
+      close(F);
+    }
+  }
+}
+
+my $mailHTML = new MIME::Lite::HTML
+  (
+   From     => 'MIME-Lite at alianwebserver.com',
+   To       => 'MIME-Lite at alianwebserver.com',
+   Subject  => 'Mail in HTML with images',
+   Debug    => 1,
+  );
+
+my %vars = ( 'perl' => 'fast', 'lng' => 'Ruby');
+cmp_ok($mailHTML->fill_template('Perl is <? $perl ?>, <? $lng ?> suck',\%vars),
+       'eq', 'Perl is fast, Ruby suck',"Call of fill_template do his job");
+unlink($t);
diff --git a/t/docs/Readme.txt b/t/docs/Readme.txt
new file mode 100644
index 0000000..2b6984f
--- /dev/null
+++ b/t/docs/Readme.txt
@@ -0,0 +1,101 @@
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
diff --git a/t/docs/acceuil.js b/t/docs/acceuil.js
new file mode 100755
index 0000000..d38b360
--- /dev/null
+++ b/t/docs/acceuil.js
@@ -0,0 +1,103 @@
+var edito = "24//06//2002";
+edito +="";
+
+// edito += "Une nouvelle page d'acceuil pour 1001cartes, notre site de cartes virtuelles... ";
+//edito += " La f�te d'HALLOWEEN est pass�e, mais les enfants restent dans l'ambiance encore toutes les vacances... ";
+edito += " L'�t� est l�, il fait chaud, et c'est bient�t les vacances ! N'oubliez pas d'envoyer une carte postale... ";
+
+function verifieUrl()
+  {
+  if (parent.document.location!=this.document.location)  
+    {parent.document.location=this.document.location;}
+  }
+// Fonction de scroll dans la barre des status
+function scrollit_r2l(seed)
+{
+  verifieUrl();
+        var m1  =edito;
+        var msg=m1;
+        var out = " ";
+        var c   = 1;
+        if (seed > 100) 
+          {
+                seed--;
+                var cmd="scrollit_r2l(" + seed + ")";
+                timerTwo=window.setTimeout(cmd,50);
+              }
+        else if (seed <= 100 && seed > 0) 
+                {
+                for (c=0 ; c < seed ; c++) {out+=" ";}
+                out+=msg;
+                seed--;
+                var cmd="scrollit_r2l(" + seed + ")";
+                    window.status=out;
+                timerTwo=window.setTimeout(cmd,50);
+             }
+       else if (seed <= 0) 
+    {
+                if (-seed < msg.length) 
+      {
+                        out+=msg.substring(-seed,msg.length);
+                        seed--;
+                        var cmd="scrollit_r2l(" + seed + ")";
+                        window.status=out;
+                        timerTwo=window.setTimeout(cmd,50);
+                  }
+                else 
+          {
+         window.status=" ";
+                        timerTwo=window.setTimeout("scrollit_r2l(100)",50);
+                  }
+          }
+  }
+
+function checkMoteur(theForm)
+{
+
+  if (theForm.MOT_CLEF.value == "")
+  {
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche .");
+    theForm.MOT_CLEF.focus();
+    return (false);
+  }
+
+  if (theForm.MOT_CLEF.value.length < 2)
+  {
+    alert("Tapez au moins 2 caract�res pour que votre recherche soit pertinente .");
+    theForm.MOT_CLEF.focus();
+    return (false);
+  }
+  return (true);
+}
+
+function checkMail(theForm)
+{
+
+  if (theForm.mail.value == "<Votre adresse Mail>")
+  {
+    alert("Vous devez donnez votre adresse Mail.");
+    theForm.mail.focus();
+    return (false);
+  }
+
+  if (theForm.mail.value.length < 5)
+  {
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");
+    theForm.mail.focus();
+    return (false);
+  }
+
+  if (theForm.mail.value.length > 30)
+  {
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");
+    theForm.mail.focus();
+    return (false);
+  }
+  return (true);
+}
+function banner(msg,ctrlwidth)
+  {
+  document.write ('<APPLET CODE=scroll WIDTH=400 HEIGHT=16>');
+  document.write ('<PARAM NAME=TEXT VALUE="$' + edito + '$">');
+  document.write ('<PARAM NAME=SPEED VALUE=fast></APPLET>');  
+  }
diff --git a/t/docs/img/fleur.gif b/t/docs/img/fleur.gif
new file mode 100755
index 0000000..d4f933e
Binary files /dev/null and b/t/docs/img/fleur.gif differ
diff --git a/t/docs/img/sommaire.gif b/t/docs/img/sommaire.gif
new file mode 100755
index 0000000..be060d1
Binary files /dev/null and b/t/docs/img/sommaire.gif differ
diff --git a/t/docs/index.cgi.html b/t/docs/index.cgi.html
new file mode 100644
index 0000000..162f912
--- /dev/null
+++ b/t/docs/index.cgi.html
@@ -0,0 +1,157 @@
+<html>
+	<head>
+		<title>~kdz13.net</title>
+		<style>
+			.title_link {
+				color : #FFFFFF;
+				text-decoration: none;
+			}
+			
+			.calend_link:active {
+				color : #FF0000;
+			}
+
+			.calend_link:visited {
+				color : #00BD00;
+				text-decoration: line-through;
+			}
+			.calend_link:hover {
+				color : #FF0000;
+				text-decoration: none;
+			}
+			
+			.calend_link:link {
+				color : #000000;
+			}
+
+			.boring_link:active {
+                                color : #FF0000;
+                                text-decoration: none;
+                        }
+
+                        .boring_link:visited {
+                                color : #000000;
+                                text-decoration: none;
+                        }
+
+                        .boring_link:hover {
+                                color : #FF0000;
+                                text-decoration: none;
+                        }
+
+			.boring_link:link {
+				color : #000000;
+                                text-decoration: none;
+			}
+		</style>
+	</head>
+	<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
+		<table cellpadding="0" cellspacing="0" border="1" ID="Table1">
+			<tr height="65">
+				<td width="175" align="center" valign="middle">
+					<a href="/">~kdz13.net</a><br>
+				</td>
+				<td align="center" valign="middle">
+<table cellpadding="0" cellspacing="0" boroder="0" width="100%"><tr><td align="left"><a href="/comics?name=norm"><img border="0" src="/images/norm.gif"></a></td></tr></table>				</td>
+			</tr>
+			<tr>
+				<td align="left" valign="top">
+					<a href="/">~home</a><br>
+					<br>
+					<a href="/comics">~comics</a><br>
+					<a href="/spamalyzer">~spamalyzer</a>
+				</td>
+				<td>
+				<TABLE width="100%" align="center" border="0" cellspacing="1" cellpadding="0" bgcolor="#dddddd">
+					<TR><td valign="top" align="middle" colspan="9" height="26px" width="648px" style=
+						"color:#ffffff; background-repeat:no-repeat" background="/images/bar.gif">
+						<a href="/comics?name=norm&date=20020919"><img border="0" src="/images/prev_month.gif"></a>
+							   
+							October 2002
+							   
+						<a href="/comics?name=norm&date=20021119"><img border="0" src="/images/next_month.gif"></a>
+					</td></TR>
+					<tr height="0">
+						<td width="29%" bgcolor="#ffffff" rowspan="8" border="0">
+							<a class="calend_link" href="/comics?name=norm&date=20021018"><--previous day</a>
+						</td>
+						<td colspan="7" bgcolor="#ffffff" border="0"></td>
+						<td width="29%" align="right" bgcolor="#ffffff" rowspan="8">
+							<a class="calend_link" href="/comics?name=norm&date=20021020">next day--></a>
+						</td>
+					</tr>
+				 	<tr height="32">
+						<td width="35" align="center"><cite> S </cite></TD>
+						<td width="35" align="center"><cite> M </cite></TD>
+						<td width="35" align="center"><cite> T </cite></TD>
+						<td width="35" align="center"><cite> W </cite></TD>
+						<td width="35" align="center"><cite> T </cite></TD>
+						<td width="35" align="center"><cite> F </cite></TD>
+						<td width="35" align="center"><cite> S </cite></TD>
+					</tr>
+				 	<tr height="32">
+<td> </td><td> </td>						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021001"> 1</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021002"> 2</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021003"> 3</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021004"> 4</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021005"> 5</a> </td>
+					</tr>
+				 	<tr height="32">
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021006"> 6</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021007"> 7</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021008"> 8</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021009"> 9</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021010">10</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021011">11</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021012">12</a> </td>
+					</tr>
+				 	<tr height="32">
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021013">13</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021014">14</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021015">15</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021016">16</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021017">17</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021018">18</a> </td>
+					<td align="center" bgcolor="#ffffff"> <B>19</B> </td>
+					</tr>
+				 	<tr height="32">
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021020">20</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021021">21</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021022">22</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021023">23</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021024">24</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021025">25</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021026">26</a> </td>
+					</tr>
+				 	<tr height="32">
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021027">27</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021028">28</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021029">29</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021030">30</a> </td>
+						<td width="35" align="center" bgcolor="#ffffff"> <a class="calend_link" href="/comics?name=norm&date=20021031">31</a> </td>
+<td> </td><td> </td>					</tr>
+				</TABLE><br>
+				<table width="100%" border="0" cellpadding="0" cellspacing="0">
+					<tr>
+						<form action="/comics?name=norm&date=20021019" method="GET" valign="middle">
+							<td align="center" valign="middle" width="100%" height="26px" style=
+	        		                                        "background-repeat:no-repeat;color:#ffffff" background="/images/bar.gif">
+								<span style="width:100px"></span>
+                        		                        <a href="/comics?name=norm&date=20021019&howmany=1" class="title_link">The Norm</a>
+								<span style="width:100px"></span>
+								<input type="hidden" name="name" value="norm" />
+								<input type="hidden" name="date" value="20021019" />
+								<input type="text" align="right" size="2" maxlength="3" value="1" name="howmany"> images per page  
+								<input type="submit" value="change" style="height:20;background-color:#ffffff;padding:0px" />
+                                        		</td>
+						</form>
+					</tr>
+					<tr><td align="center">
+						<a href="/comics?name=norm&date=20021019"><img src="/images/comics/showcomik.cgi?name=norm&date=20021019" border="0"></a>
+						<br><br>
+					</td></tr>
+				</table>				</td>
+			</tr>
+		</table>
+	</body>
+</html>
diff --git a/t/docs/normal.html b/t/docs/normal.html
new file mode 100644
index 0000000..85b7834
--- /dev/null
+++ b/t/docs/normal.html
@@ -0,0 +1,38 @@
+<html>
+<head>
+<title></title>
+<link rel="stylesheet" href="soft.css">
+<LINK REV="made" HREF="mailto:alian at alianwebserver.com">
+<body>
+<script src="acceuil.js" type="text/javascript"></script>
+	<h1>Alianet Network</h1>
+	<img src="img/sommaire.gif" alt="Alian" border="0">
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href="http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href="http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href="http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href="http://docs.alianet">Documentation</a></li>
+  <li>  <a href="javascript:alert('http://validator.alianet');">Validator HTML</a></li>
+  <li>  <a href="/ldap">Annuaire LDAP</a></li>
+  <li>  <a href="/phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href="http://saturne.alianet/mod-perl/circa/admin.cgi">Administration Circa</a></li>
+  <li>  <a href="/mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi</a></li>
+  <li>  <a href="http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog</a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href="http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href="http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href="http://www.comclick.com">Publicité Alianwebserver</a></li> 
+  <li>  <a href="http://www.alianwebserver.com/stats/">Stats Alianwebserver</a></li>
+  <li>  <a href="http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href="http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href="http://www.google.com">Google</a></li>
+  <li>  <a href="http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
diff --git a/t/docs/soft.css b/t/docs/soft.css
new file mode 100644
index 0000000..a865299
--- /dev/null
+++ b/t/docs/soft.css
@@ -0,0 +1,21 @@
+body {
+  margin: 2em 1em 2em 70px;
+  font-family: sans-serif;
+  color: black;
+  background: white;
+  background-position: top left;
+  background-attachment: fixed;
+  background-repeat: no-repeat;
+}
+
+th, td { /* ns 4 */
+  font-family: sans-serif;
+}
+
+h1, h2, h3, h4, h5, h6 { text-align: left }
+h1, h2, h3 { color: #005A9C }
+h1 { font: 150% sans-serif }
+h2 { font: 130% sans-serif }
+h3 { font: 110% sans-serif }
+h4 { font: bold 100% sans-serif }
+h5 { font: italic 100% sans-serif }
diff --git a/t/docs/space_in_a_href.html b/t/docs/space_in_a_href.html
new file mode 100644
index 0000000..7b1517e
--- /dev/null
+++ b/t/docs/space_in_a_href.html
@@ -0,0 +1,37 @@
+<html>
+<head>
+<title></title>
+<link rel="stylesheet" href="soft.css">
+<LINK REV="made" HREF="mailto:alian at alianwebserver.com">
+<body>
+<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href =  "http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href ="http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href= "http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href= "http://docs.alianet">Documentation</a></li>
+  <li>  <a href ="http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href="/ldap">Annuaire LDAP</a></li>
+  <li>  <a href="/phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href="http://saturne.alianet/mod-perl/circa/admin.cgi">Administration Circa</a></li>
+  <li>  <a href="/mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi</a></li>
+  <li>  <a href="http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog</a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href="http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href="http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href="http://www.comclick.com">Publicité Alianwebserver</a></li> 
+  <li>  <a href="http://www.alianwebserver.com/stats/">Stats Alianwebserver</a></li>
+  <li>  <a href="http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href="http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href="http://www.google.com">Google</a></li>
+  <li>  <a href="http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
diff --git a/t/docs/space_in_ccs_href.html b/t/docs/space_in_ccs_href.html
new file mode 100644
index 0000000..0f9ee03
--- /dev/null
+++ b/t/docs/space_in_ccs_href.html
@@ -0,0 +1,37 @@
+<html>
+<head>
+<title></title>
+<link rel="stylesheet" href = "soft.css">
+<LINK REV="made" HREF="mailto:alian at alianwebserver.com">
+<body>
+<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href="http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href="http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href="http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href="http://docs.alianet">Documentation</a></li>
+  <li>  <a href="http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href="/ldap">Annuaire LDAP</a></li>
+  <li>  <a href="/phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href="http://saturne.alianet/mod-perl/circa/admin.cgi">Administration Circa</a></li>
+  <li>  <a href="/mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi</a></li>
+  <li>  <a href="http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog</a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href="http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href="http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href="http://www.comclick.com">Publicité Alianwebserver</a></li> 
+  <li>  <a href="http://www.alianwebserver.com/stats/">Stats Alianwebserver</a></li>
+  <li>  <a href="http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href="http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href="http://www.google.com">Google</a></li>
+  <li>  <a href="http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
diff --git a/t/docs/space_in_img.html b/t/docs/space_in_img.html
new file mode 100644
index 0000000..8b1dac6
--- /dev/null
+++ b/t/docs/space_in_img.html
@@ -0,0 +1,40 @@
+<html>
+<head>
+<title></title>
+<link rel="stylesheet" href="soft.css">
+<LINK REV="made" HREF="mailto:alian at alianwebserver.com">
+<body>
+<script src="acceuil.js" type="text/javascript"></script>
+	<h1>Alianet Network</h1>
+	<img src ="img/sommaire.gif" alt="Alian" border="0">
+	<img src = "img/sommaire.gif" alt="Alian" border="0">
+	<img src= "img/sommaire.gif" alt="Alian" border="0">
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href="http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href="http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href="http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href="http://docs.alianet">Documentation</a></li>
+  <li>  <a href="http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href="/ldap">Annuaire LDAP</a></li>
+  <li>  <a href="/phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href="http://saturne.alianet/mod-perl/circa/admin.cgi">Administration Circa</a></li>
+  <li>  <a href="/mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi</a></li>
+  <li>  <a href="http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog</a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href="http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href="http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href="http://www.comclick.com">Publicité Alianwebserver</a></li> 
+  <li>  <a href="http://www.alianwebserver.com/stats/">Stats Alianwebserver</a></li>
+  <li>  <a href="http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href="http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href="http://www.google.com">Google</a></li>
+  <li>  <a href="http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
diff --git a/t/docs/space_in_javascript.html b/t/docs/space_in_javascript.html
new file mode 100644
index 0000000..623c9c1
--- /dev/null
+++ b/t/docs/space_in_javascript.html
@@ -0,0 +1,38 @@
+<html>
+<head>
+<title></title>
+<link rel="stylesheet" href="soft.css">
+<LINK REV="made" HREF="mailto:alian at alianwebserver.com">
+<body>
+<script src ="acceuil.js" type="text/javascript"></script>
+	<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href="http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href="http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href="http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href="http://docs.alianet">Documentation</a></li>
+  <li>  <a href="http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href="/ldap">Annuaire LDAP</a></li>
+  <li>  <a href="/phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href="http://saturne.alianet/mod-perl/circa/admin.cgi">Administration Circa</a></li>
+  <li>  <a href="/mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi</a></li>
+  <li>  <a href="http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog</a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href="http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href="http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href="http://www.comclick.com">Publicité Alianwebserver</a></li> 
+  <li>  <a href="http://www.alianwebserver.com/stats/">Stats Alianwebserver</a></li>
+  <li>  <a href="http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href="http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href="http://www.google.com">Google</a></li>
+  <li>  <a href="http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
diff --git a/t/docs/space_in_javascript2.html b/t/docs/space_in_javascript2.html
new file mode 100644
index 0000000..b9c1a25
--- /dev/null
+++ b/t/docs/space_in_javascript2.html
@@ -0,0 +1,38 @@
+<html>
+<head>
+<title></title>
+<link rel="stylesheet" href="soft.css">
+<LINK REV="made" HREF="mailto:alian at alianwebserver.com">
+<body>
+<script src = "acceuil.js" type="text/javascript"></script>
+	<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href="http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href="http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href="http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href="http://docs.alianet">Documentation</a></li>
+  <li>  <a href="http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href="/ldap">Annuaire LDAP</a></li>
+  <li>  <a href="/phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href="http://saturne.alianet/mod-perl/circa/admin.cgi">Administration Circa</a></li>
+  <li>  <a href="/mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi</a></li>
+  <li>  <a href="http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog</a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href="http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href="http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href="http://www.comclick.com">Publicité Alianwebserver</a></li> 
+  <li>  <a href="http://www.alianwebserver.com/stats/">Stats Alianwebserver</a></li>
+  <li>  <a href="http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href="http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href="http://www.google.com">Google</a></li>
+  <li>  <a href="http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
diff --git a/t/ref/img/fleur.eml.cid b/t/ref/img/fleur.eml.cid
new file mode 100644
index 0000000..6ec4cb8
--- /dev/null
+++ b/t/ref/img/fleur.eml.cid
@@ -0,0 +1,26 @@
+MIME-Version: 1.0
+Content-Id: <74657374732f646f63732f696d672f666c6575722e676966 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+R0lGODlhEwAUAPcAAMysr9zQ055YdPz3+pSMkf/v/f/8//Dt9cG7zODc6Lq3wsvB7vv6/8nD6vPx
+/+3r/8rI4oWFj+Tk9N/f4+Hi/2xvoOLk//Hy/s7S6tXZ8Ovu//P0+sjM4MrQ6PL0/dvc4LzF5fH0
+/9vj/ujs+eDo/uvw/+Lp99vg6qOosezy/Z6sw42Un97k7snN06PB6t/p9uDo8+nx/Ojw+7G2vaez
+wr/O3svU3rrY9rjI2Ov1/9vf4/b6/t3h5ebt89ju/87f7Pb7/9zx/+Dy/8To/5WfpdTw/8vd5ubu
+8vn9/9/1/9zr8c7t+eLu8vf9/+z6/sXt99ns8Onu7+r8/+79/7Lb3u/9/s7//9D+/tj//+X//+n/
+/+///9vq6vX///f///n///v///v+/v7//5Ggn+j29en08+3//ff//t338+79+uT99+X08PD++rri
+1ZnYw/f9+/b++u338Ov17OHv4f7//vP88sXKxKOrodno0dXswPv/9e//1ElTI2FnST1CIvz+8Iye
+AP7/9v7/98TWAPL04NPUyODpAOHiyf7/6ry+ALCzAPv80///z6Cgkf//7v//8P//8f//8v//8/v7
+7///9P//9f//9v//9///+f//+9XV0v///f///sC5AM3EAP/2VeDfx//+6f/+7NzLAPfoQIt8AP/x
+Yv/5vtG5ALGcALqcAKiLAKyJAOzm2vr599TRzMWOQPrWoYV8cIlLALGbh8SnlP///////wAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAALcALAAAAAATABQA
+QAj/AG8JFGiLiAJbAG6psDWw4cAfgiLB6pRo1adFNuBYMGHrSUNbXmxNiGCL4S1bFRze0mKgA52S
+ZyT9mYSoxAlbVwbaagIkjBMpnB7lQTFACYQ0MBpYcWgrRxRbYnbYemFmBhYOKm218rNpDyVKlbas
+eVPG5C0uJW25OnRp1qhBgEqJYkLmi4cPDhslKRknE5tbLE5mKJJApZAQDMcMpKVSp5ERthxkaQHG
+loDGoNp0YaDBFpgURzJJsHXArMAvD/jYKvAKTSBJemT00EHCNMFaVCylQmUqVI86tpa4WCDwzoVC
+suZgUGXIkyJSpyDhQeCDYQBbU2JUwYRJDYFYrBhxMJJjS5ObrGJE2CLkKFOfFbaggNiAI0hDJCXt
+8OBE4aTthjWkddINBA3R2EA0HNhQQAA7
diff --git a/t/ref/img/fleur.eml.location b/t/ref/img/fleur.eml.location
new file mode 100644
index 0000000..962027b
--- /dev/null
+++ b/t/ref/img/fleur.eml.location
@@ -0,0 +1,26 @@
+MIME-Version: 1.0
+Content-Location: file:///var/tmp/mime-lite-html-tests/docs/img/fleur.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+R0lGODlhEwAUAPcAAMysr9zQ055YdPz3+pSMkf/v/f/8//Dt9cG7zODc6Lq3wsvB7vv6/8nD6vPx
+/+3r/8rI4oWFj+Tk9N/f4+Hi/2xvoOLk//Hy/s7S6tXZ8Ovu//P0+sjM4MrQ6PL0/dvc4LzF5fH0
+/9vj/ujs+eDo/uvw/+Lp99vg6qOosezy/Z6sw42Un97k7snN06PB6t/p9uDo8+nx/Ojw+7G2vaez
+wr/O3svU3rrY9rjI2Ov1/9vf4/b6/t3h5ebt89ju/87f7Pb7/9zx/+Dy/8To/5WfpdTw/8vd5ubu
+8vn9/9/1/9zr8c7t+eLu8vf9/+z6/sXt99ns8Onu7+r8/+79/7Lb3u/9/s7//9D+/tj//+X//+n/
+/+///9vq6vX///f///n///v///v+/v7//5Ggn+j29en08+3//ff//t338+79+uT99+X08PD++rri
+1ZnYw/f9+/b++u338Ov17OHv4f7//vP88sXKxKOrodno0dXswPv/9e//1ElTI2FnST1CIvz+8Iye
+AP7/9v7/98TWAPL04NPUyODpAOHiyf7/6ry+ALCzAPv80///z6Cgkf//7v//8P//8f//8v//8/v7
+7///9P//9f//9v//9///+f//+9XV0v///f///sC5AM3EAP/2VeDfx//+6f/+7NzLAPfoQIt8AP/x
+Yv/5vtG5ALGcALqcAKiLAKyJAOzm2vr599TRzMWOQPrWoYV8cIlLALGbh8SnlP///////wAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAALcALAAAAAATABQA
+QAj/AG8JFGiLiAJbAG6psDWw4cAfgiLB6pRo1adFNuBYMGHrSUNbXmxNiGCL4S1bFRze0mKgA52S
+ZyT9mYSoxAlbVwbaagIkjBMpnB7lQTFACYQ0MBpYcWgrRxRbYnbYemFmBhYOKm218rNpDyVKlbas
+eVPG5C0uJW25OnRp1qhBgEqJYkLmi4cPDhslKRknE5tbLE5mKJJApZAQDMcMpKVSp5ERthxkaQHG
+loDGoNp0YaDBFpgURzJJsHXArMAvD/jYKvAKTSBJemT00EHCNMFaVCylQmUqVI86tpa4WCDwzoVC
+suZgUGXIkyJSpyDhQeCDYQBbU2JUwYRJDYFYrBhxMJJjS5ObrGJE2CLkKFOfFbaggNiAI0hDJCXt
+8OBE4aTthjWkddINBA3R2EA0HNhQQAA7
diff --git a/t/ref/img/fleur.gif b/t/ref/img/fleur.gif
new file mode 100644
index 0000000..e3eaed6
--- /dev/null
+++ b/t/ref/img/fleur.gif
@@ -0,0 +1,25 @@
+Content-Location: file:///var/tmp/mime-lite-html-tests/docs/img/fleur.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+R0lGODlhEwAUAPcAAMysr9zQ055YdPz3+pSMkf/v/f/8//Dt9cG7zODc6Lq3wsvB7vv6/8nD6vPx
+/+3r/8rI4oWFj+Tk9N/f4+Hi/2xvoOLk//Hy/s7S6tXZ8Ovu//P0+sjM4MrQ6PL0/dvc4LzF5fH0
+/9vj/ujs+eDo/uvw/+Lp99vg6qOosezy/Z6sw42Un97k7snN06PB6t/p9uDo8+nx/Ojw+7G2vaez
+wr/O3svU3rrY9rjI2Ov1/9vf4/b6/t3h5ebt89ju/87f7Pb7/9zx/+Dy/8To/5WfpdTw/8vd5ubu
+8vn9/9/1/9zr8c7t+eLu8vf9/+z6/sXt99ns8Onu7+r8/+79/7Lb3u/9/s7//9D+/tj//+X//+n/
+/+///9vq6vX///f///n///v///v+/v7//5Ggn+j29en08+3//ff//t338+79+uT99+X08PD++rri
+1ZnYw/f9+/b++u338Ov17OHv4f7//vP88sXKxKOrodno0dXswPv/9e//1ElTI2FnST1CIvz+8Iye
+AP7/9v7/98TWAPL04NPUyODpAOHiyf7/6ry+ALCzAPv80///z6Cgkf//7v//8P//8f//8v//8/v7
+7///9P//9f//9v//9///+f//+9XV0v///f///sC5AM3EAP/2VeDfx//+6f/+7NzLAPfoQIt8AP/x
+Yv/5vtG5ALGcALqcAKiLAKyJAOzm2vr599TRzMWOQPrWoYV8cIlLALGbh8SnlP///////wAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAALcALAAAAAATABQA
+QAj/AG8JFGiLiAJbAG6psDWw4cAfgiLB6pRo1adFNuBYMGHrSUNbXmxNiGCL4S1bFRze0mKgA52S
+ZyT9mYSoxAlbVwbaagIkjBMpnB7lQTFACYQ0MBpYcWgrRxRbYnbYemFmBhYOKm218rNpDyVKlbas
+eVPG5C0uJW25OnRp1qhBgEqJYkLmi4cPDhslKRknE5tbLE5mKJJApZAQDMcMpKVSp5ERthxkaQHG
+loDGoNp0YaDBFpgURzJJsHXArMAvD/jYKvAKTSBJemT00EHCNMFaVCylQmUqVI86tpa4WCDwzoVC
+suZgUGXIkyJSpyDhQeCDYQBbU2JUwYRJDYFYrBhxMJJjS5ObrGJE2CLkKFOfFbaggNiAI0hDJCXt
+8OBE4aTthjWkddINBA3R2EA0HNhQQAA7
diff --git a/t/ref/img/sommaire.eml.cid b/t/ref/img/sommaire.eml.cid
new file mode 100644
index 0000000..b104d86
--- /dev/null
+++ b/t/ref/img/sommaire.eml.cid
@@ -0,0 +1,18 @@
+MIME-Version: 1.0
+Content-Id: <57374732f646f63732f696d672f736f6d6d616972652e676966 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+R0lGODlhMgAyANX/AP///9b//87//8b//8bv773n57X//7Xv77XW1q3//63OzqXGxpzv75zGxpy1
+tZT3/5StrYylpYT3/3v3/3uUlHP3/3OMjGulpWuEhGNzc1qMjFpra1JjY8DAwEpjY0pSUjlKSjk5
+OTFCQik5OSEpKRghIRgYGADn9wDe7wDO3gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAB0ALAAAAAAyADIAQAb/wI5w
+SCwaj8ikcslsOlUAg3RKraqcz4B2y+16v2BwInXtqMLotDowGJfPWozqE8A4Ao5RQEVYkOoYe31/
+GIF0GYEiC4IBGRANHhpkQiqVlpeYmZqbnJZYn6ChoqBnKaanqKmqKKytrKqwp29rtLVsbpRaDhwY
+ELZqKgVfbZNmAcIFi1p9BL/HBQTCXwQNBbij2Nna29zZnZfdRlAn5OXm5+Zl23DO7V3X7O7tAsSz
+8vL1uffz+cYLJc0Q7KPV78wCgXUscLCg5Y9BEYD2BFgAsRCCiokWwQFBIcCBC8XiDazVL5zJkyhT
+qlzJsqXLl0OgAJhJsyZNdSehTJDwoILPwJ8+H0yoMKEoznUAXCldujRTiG+ZciWYSrWq1atYqW7J
+OjWkLQMjtcALu2aAWbNjydKil1atGrZe3b4tKLds27ph6BYwoQWEWmld4NojUULBMkQhEPxTUIIC
+BhIKFjd+bHhDBhEKCoRY8C8DCQIcMoBg4LVZAAQlIijScsZgiIiuIzqIsCHQZokBIArOteCDAwcg
+opFwYEeBCgUYTCgAAcLB8eTLQRinAOIDagwLjp82QWJ0XLxgdhsDH74kTCVBAAA7
diff --git a/t/ref/img/sommaire.eml.location b/t/ref/img/sommaire.eml.location
new file mode 100644
index 0000000..b1d76e7
--- /dev/null
+++ b/t/ref/img/sommaire.eml.location
@@ -0,0 +1,18 @@
+MIME-Version: 1.0
+Content-Location: file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+R0lGODlhMgAyANX/AP///9b//87//8b//8bv773n57X//7Xv77XW1q3//63OzqXGxpzv75zGxpy1
+tZT3/5StrYylpYT3/3v3/3uUlHP3/3OMjGulpWuEhGNzc1qMjFpra1JjY8DAwEpjY0pSUjlKSjk5
+OTFCQik5OSEpKRghIRgYGADn9wDe7wDO3gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAB0ALAAAAAAyADIAQAb/wI5w
+SCwaj8ikcslsOlUAg3RKraqcz4B2y+16v2BwInXtqMLotDowGJfPWozqE8A4Ao5RQEVYkOoYe31/
+GIF0GYEiC4IBGRANHhpkQiqVlpeYmZqbnJZYn6ChoqBnKaanqKmqKKytrKqwp29rtLVsbpRaDhwY
+ELZqKgVfbZNmAcIFi1p9BL/HBQTCXwQNBbij2Nna29zZnZfdRlAn5OXm5+Zl23DO7V3X7O7tAsSz
+8vL1uffz+cYLJc0Q7KPV78wCgXUscLCg5Y9BEYD2BFgAsRCCiokWwQFBIcCBC8XiDazVL5zJkyhT
+qlzJsqXLl0OgAJhJsyZNdSehTJDwoILPwJ8+H0yoMKEoznUAXCldujRTiG+ZciWYSrWq1atYqW7J
+OjWkLQMjtcALu2aAWbNjydKil1atGrZe3b4tKLds27ph6BYwoQWEWmld4NojUULBMkQhEPxTUIIC
+BhIKFjd+bHhDBhEKCoRY8C8DCQIcMoBg4LVZAAQlIijScsZgiIiuIzqIsCHQZokBIArOteCDAwcg
+opFwYEeBCgUYTCgAAcLB8eTLQRinAOIDagwLjp82QWJ0XLxgdhsDH74kTCVBAAA7
diff --git a/t/ref/img/sommaire.gif b/t/ref/img/sommaire.gif
new file mode 100644
index 0000000..a8193f5
--- /dev/null
+++ b/t/ref/img/sommaire.gif
@@ -0,0 +1,17 @@
+Content-Location: file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+R0lGODlhMgAyANX/AP///9b//87//8b//8bv773n57X//7Xv77XW1q3//63OzqXGxpzv75zGxpy1
+tZT3/5StrYylpYT3/3v3/3uUlHP3/3OMjGulpWuEhGNzc1qMjFpra1JjY8DAwEpjY0pSUjlKSjk5
+OTFCQik5OSEpKRghIRgYGADn9wDe7wDO3gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAB0ALAAAAAAyADIAQAb/wI5w
+SCwaj8ikcslsOlUAg3RKraqcz4B2y+16v2BwInXtqMLotDowGJfPWozqE8A4Ao5RQEVYkOoYe31/
+GIF0GYEiC4IBGRANHhpkQiqVlpeYmZqbnJZYn6ChoqBnKaanqKmqKKytrKqwp29rtLVsbpRaDhwY
+ELZqKgVfbZNmAcIFi1p9BL/HBQTCXwQNBbij2Nna29zZnZfdRlAn5OXm5+Zl23DO7V3X7O7tAsSz
+8vL1uffz+cYLJc0Q7KPV78wCgXUscLCg5Y9BEYD2BFgAsRCCiokWwQFBIcCBC8XiDazVL5zJkyhT
+qlzJsqXLl0OgAJhJsyZNdSehTJDwoILPwJ8+H0yoMKEoznUAXCldujRTiG+ZciWYSrWq1atYqW7J
+OjWkLQMjtcALu2aAWbNjydKil1atGrZe3b4tKLds27ph6BYwoQWEWmld4NojUULBMkQhEPxTUIIC
+BhIKFjd+bHhDBhEKCoRY8C8DCQIcMoBg4LVZAAQlIijScsZgiIiuIzqIsCHQZokBIArOteCDAwcg
+opFwYEeBCgUYTCgAAcLB8eTLQRinAOIDagwLjp82QWJ0XLxgdhsDH74kTCVBAAA7
diff --git a/t/ref/img/sommaire1.gif b/t/ref/img/sommaire1.gif
new file mode 100644
index 0000000..122ebad
--- /dev/null
+++ b/t/ref/img/sommaire1.gif
@@ -0,0 +1,17 @@
+Content-Location: file:///home/alian/project/CPAN/MIME/Lite/HTML/t/docs/img/sommaire1.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+R0lGODlhMgAyANX/AP///9b//87//8b//8bv773n57X//7Xv77XW1q3//63OzqXGxpzv75zGxpy1
+tZT3/5StrYylpYT3/3v3/3uUlHP3/3OMjGulpWuEhGNzc1qMjFpra1JjY8DAwEpjY0pSUjlKSjk5
+OTFCQik5OSEpKRghIRgYGADn9wDe7wDO3gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAB0ALAAAAAAyADIAQAb/wI5w
+SCwaj8ikcslsOlUAg3RKraqcz4B2y+16v2BwInXtqMLotDowGJfPWozqE8A4Ao5RQEVYkOoYe31/
+GIF0GYEiC4IBGRANHhpkQiqVlpeYmZqbnJZYn6ChoqBnKaanqKmqKKytrKqwp29rtLVsbpRaDhwY
+ELZqKgVfbZNmAcIFi1p9BL/HBQTCXwQNBbij2Nna29zZnZfdRlAn5OXm5+Zl23DO7V3X7O7tAsSz
+8vL1uffz+cYLJc0Q7KPV78wCgXUscLCg5Y9BEYD2BFgAsRCCiokWwQFBIcCBC8XiDazVL5zJkyhT
+qlzJsqXLl0OgAJhJsyZNdSehTJDwoILPwJ8+H0yoMKEoznUAXCldujRTiG+ZciWYSrWq1atYqW7J
+OjWkLQMjtcALu2aAWbNjydKil1atGrZe3b4tKLds27ph6BYwoQWEWmld4NojUULBMkQhEPxTUIIC
+BhIKFjd+bHhDBhEKCoRY8C8DCQIcMoBg4LVZAAQlIijScsZgiIiuIzqIsCHQZokBIArOteCDAwcg
+opFwYEeBCgUYTCgAAcLB8eTLQRinAOIDagwLjp82QWJ0XLxgdhsDH74kTCVBAAA7
diff --git a/t/ref/index.cgi.eml.cid b/t/ref/index.cgi.eml.cid
new file mode 100644
index 0000000..726efcb
--- /dev/null
+++ b/t/ref/index.cgi.eml.cid
@@ -0,0 +1,313 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Type: multipart/related; boundary="alian-mime-lite-html"
+
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+	<head>
+		<title>~kdz13.net</title>
+		<style>
+			.title_link {
+				color : #FFFFFF;
+				text-decoration: none;
+			}
+=09=09=09
+			.calend_link:active {
+				color : #FF0000;
+			}
+
+			.calend_link:visited {
+				color : #00BD00;
+				text-decoration: line-through;
+			}
+			.calend_link:hover {
+				color : #FF0000;
+				text-decoration: none;
+			}
+=09=09=09
+			.calend_link:link {
+				color : #000000;
+			}
+
+			.boring_link:active {
+                                color : #FF0000;
+                                text-decoration: none;
+                        }
+
+                        .boring_link:visited {
+                                color : #000000;
+                                text-decoration: none;
+                        }
+
+                        .boring_link:hover {
+                                color : #FF0000;
+                                text-decoration: none;
+                        }
+
+			.boring_link:link {
+				color : #000000;
+                                text-decoration: none;
+			}
+		</style>
+	</head>
+	<body topmargin=3D"0" leftmargin=3D"0" marginheight=3D"0" marginwidth=3D"0=
+">
+		<table cellpadding=3D"0" cellspacing=3D"0" border=3D"1" ID=3D"Table1">
+			<tr height=3D"65">
+				<td width=3D"175" align=3D"center" valign=3D"middle">
+					<a href=3D"file:///">~kdz13.net</a><br>
+				</td>
+				<td align=3D"center" valign=3D"middle">
+<table cellpadding=3D"0" cellspacing=3D"0" boroder=3D"0" width=3D"100%"><tr=
+><td align=3D"left"><a href=3D"file:///comics?name=3Dnorm"><img  border=3D"=
+0" src=3D"cid:6e6f726d2e676966 at MIME-Lite-HTML-1.23"></a></td></tr></table>	=
+			</td>
+			</tr>
+			<tr>
+				<td align=3D"left" valign=3D"top">
+					<a href=3D"file:///">~home</a><br>
+					<br>
+					<a href=3D"file:///comics">~comics</a><br>
+					<a href=3D"file:///spamalyzer">~spamalyzer</a>
+				</td>
+				<td>
+				<TABLE width=3D"100%" align=3D"center" border=3D"0" cellspacing=3D"1" c=
+ellpadding=3D"0" bgcolor=3D"#dddddd">
+					<TR><td valign=3D"top" align=3D"middle" colspan=3D"9" height=3D"26px" =
+width=3D"648px" style=3D
+						"color:#ffffff; background-repeat:no-repeat"  background=3D"cid:f6261=
+722e676966 at MIME-Lite-HTML-1.23">
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20020919"><img  border=
+=3D"0" src=3D"cid:765f6d6f6e74682e676966 at MIME-Lite-HTML-1.23"></a>
+							   
+							October 2002
+							   
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20021119"><img  border=
+=3D"0" src=3D"cid:745f6d6f6e74682e676966 at MIME-Lite-HTML-1.23"></a>
+					</td></TR>
+					<tr height=3D"0">
+						<td width=3D"29%" bgcolor=3D"#ffffff" rowspan=3D"8" border=3D"0">
+							<a class=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D2=
+0021018"><--previous day</a>
+						</td>
+						<td colspan=3D"7" bgcolor=3D"#ffffff" border=3D"0"></td>
+						<td width=3D"29%" align=3D"right" bgcolor=3D"#ffffff" rowspan=3D"8">
+							<a class=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D2=
+0021020">next day--></a>
+						</td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center"><cite> S </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> M </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> T </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> W </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> T </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> F </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> S </cite></TD>
+					</tr>
+				 	<tr height=3D"32">
+<td> </td><td> </td>						<td width=3D"35" align=3D"center" bgcol=
+or=3D"#ffffff"> <a class=3D"calend_link" href=3D"file:///comics?name=
+=3Dnorm&date=3D20021001"> 1</a> </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021002"> 2</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021003"> 3</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021004"> 4</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021005"> 5</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021006"> 6</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021007"> 7</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021008"> 8</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021009"> 9</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021010">10</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021011">11</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021012">12</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021013">13</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021014">14</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021015">15</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021016">16</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021017">17</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021018">18</a>=
+ </td>
+					<td align=3D"center" bgcolor=3D"#ffffff"> <B>19</B> </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021020">20</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021021">21</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021022">22</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021023">23</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021024">24</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021025">25</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021026">26</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021027">27</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021028">28</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021029">29</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021030">30</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021031">31</a>=
+ </td>
+<td> </td><td> </td>					</tr>
+				</TABLE><br>
+				<table width=3D"100%" border=3D"0" cellpadding=3D"0" cellspacing=3D"0">
+					<tr>
+						<form   action=3D"file:///comics?name=3Dnorm&date=3D20021019" method=
+=3D"GET" valign=3D"middle">
+							<td align=3D"center" valign=3D"middle" width=3D"100%" height=3D"26px=
+" style=3D
+	        		                                        "background-repeat:no-re=
+peat;color:#ffffff"  background=3D"cid:f6261722e676966 at MIME-Lite-HTML-1.23">
+								<span style=3D"width:100px"></span>
+                        		                        <a href=3D"file:///comics=
+?name=3Dnorm&date=3D20021019&howmany=3D1" class=3D"title_link">The Norm</a>
+								<span style=3D"width:100px"></span>
+								<input type=3D"hidden" name=3D"name" value=3D"norm" />
+								<input type=3D"hidden" name=3D"date" value=3D"20021019" />
+								<input type=3D"text" align=3D"right" size=3D"2" maxlength=3D"3" val=
+ue=3D"1" name=3D"howmany"> images per page  
+								<input type=3D"submit" value=3D"change" style=3D"height:20;backgrou=
+nd-color:#ffffff;padding:0px" />
+                                        		</td>
+						</form>
+					</tr>
+					<tr><td align=3D"center">
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20021019"><img  src=3D"c=
+id:67693f6e616d653d6e6f726d26646174653d3230303231303139 at MIME-Lite-HTML-1.23=
+" border=3D"0"></a>
+						<br><br>
+					</td></tr>
+				</table>				</td>=0D
+			</tr>=0D
+		</table>=0D
+	</body>=0D
+</html>=0D
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <6e6f726d2e676966 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <f6261722e676966 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <765f6d6f6e74682e676966 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <745f6d6f6e74682e676966 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <67693f6e616d653d6e6f726d26646174653d3230303231303139 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: application/x-shockwave-flash
+
+
+
+--alian-mime-lite-html--
+
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/index.cgi.eml.extern b/t/ref/index.cgi.eml.extern
new file mode 100644
index 0000000..e3ac526
--- /dev/null
+++ b/t/ref/index.cgi.eml.extern
@@ -0,0 +1,262 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+	<head>
+		<title>~kdz13.net</title>
+		<style>
+			.title_link {
+				color : #FFFFFF;
+				text-decoration: none;
+			}
+=09=09=09
+			.calend_link:active {
+				color : #FF0000;
+			}
+
+			.calend_link:visited {
+				color : #00BD00;
+				text-decoration: line-through;
+			}
+			.calend_link:hover {
+				color : #FF0000;
+				text-decoration: none;
+			}
+=09=09=09
+			.calend_link:link {
+				color : #000000;
+			}
+
+			.boring_link:active {
+                                color : #FF0000;
+                                text-decoration: none;
+                        }
+
+                        .boring_link:visited {
+                                color : #000000;
+                                text-decoration: none;
+                        }
+
+                        .boring_link:hover {
+                                color : #FF0000;
+                                text-decoration: none;
+                        }
+
+			.boring_link:link {
+				color : #000000;
+                                text-decoration: none;
+			}
+		</style>
+	</head>
+	<body topmargin=3D"0" leftmargin=3D"0" marginheight=3D"0" marginwidth=3D"0=
+">
+		<table cellpadding=3D"0" cellspacing=3D"0" border=3D"1" ID=3D"Table1">
+			<tr height=3D"65">
+				<td width=3D"175" align=3D"center" valign=3D"middle">
+					<a href=3D"file:///">~kdz13.net</a><br>
+				</td>
+				<td align=3D"center" valign=3D"middle">
+<table cellpadding=3D"0" cellspacing=3D"0" boroder=3D"0" width=3D"100%"><tr=
+><td align=3D"left"><a href=3D"file:///comics?name=3Dnorm"><img  border=3D"=
+0" src=3D"file:///images/norm.gif"></a></td></tr></table>				</td>
+			</tr>
+			<tr>
+				<td align=3D"left" valign=3D"top">
+					<a href=3D"file:///">~home</a><br>
+					<br>
+					<a href=3D"file:///comics">~comics</a><br>
+					<a href=3D"file:///spamalyzer">~spamalyzer</a>
+				</td>
+				<td>
+				<TABLE width=3D"100%" align=3D"center" border=3D"0" cellspacing=3D"1" c=
+ellpadding=3D"0" bgcolor=3D"#dddddd">
+					<TR><td valign=3D"top" align=3D"middle" colspan=3D"9" height=3D"26px" =
+width=3D"648px" style=3D
+						"color:#ffffff; background-repeat:no-repeat"  background=3D"file:///i=
+mages/bar.gif">
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20020919"><img  border=
+=3D"0" src=3D"file:///images/prev_month.gif"></a>
+							   
+							October 2002
+							   
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20021119"><img  border=
+=3D"0" src=3D"file:///images/next_month.gif"></a>
+					</td></TR>
+					<tr height=3D"0">
+						<td width=3D"29%" bgcolor=3D"#ffffff" rowspan=3D"8" border=3D"0">
+							<a class=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D2=
+0021018"><--previous day</a>
+						</td>
+						<td colspan=3D"7" bgcolor=3D"#ffffff" border=3D"0"></td>
+						<td width=3D"29%" align=3D"right" bgcolor=3D"#ffffff" rowspan=3D"8">
+							<a class=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D2=
+0021020">next day--></a>
+						</td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center"><cite> S </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> M </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> T </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> W </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> T </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> F </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> S </cite></TD>
+					</tr>
+				 	<tr height=3D"32">
+<td> </td><td> </td>						<td width=3D"35" align=3D"center" bgcol=
+or=3D"#ffffff"> <a class=3D"calend_link" href=3D"file:///comics?name=
+=3Dnorm&date=3D20021001"> 1</a> </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021002"> 2</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021003"> 3</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021004"> 4</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021005"> 5</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021006"> 6</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021007"> 7</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021008"> 8</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021009"> 9</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021010">10</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021011">11</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021012">12</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021013">13</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021014">14</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021015">15</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021016">16</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021017">17</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021018">18</a>=
+ </td>
+					<td align=3D"center" bgcolor=3D"#ffffff"> <B>19</B> </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021020">20</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021021">21</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021022">22</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021023">23</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021024">24</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021025">25</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021026">26</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021027">27</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021028">28</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021029">29</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021030">30</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021031">31</a>=
+ </td>
+<td> </td><td> </td>					</tr>
+				</TABLE><br>
+				<table width=3D"100%" border=3D"0" cellpadding=3D"0" cellspacing=3D"0">
+					<tr>
+						<form   action=3D"file:///comics?name=3Dnorm&date=3D20021019" method=
+=3D"GET" valign=3D"middle">
+							<td align=3D"center" valign=3D"middle" width=3D"100%" height=3D"26px=
+" style=3D
+	        		                                        "background-repeat:no-re=
+peat;color:#ffffff"  background=3D"file:///images/bar.gif">
+								<span style=3D"width:100px"></span>
+                        		                        <a href=3D"file:///comics=
+?name=3Dnorm&date=3D20021019&howmany=3D1" class=3D"title_link">The Norm</a>
+								<span style=3D"width:100px"></span>
+								<input type=3D"hidden" name=3D"name" value=3D"norm" />
+								<input type=3D"hidden" name=3D"date" value=3D"20021019" />
+								<input type=3D"text" align=3D"right" size=3D"2" maxlength=3D"3" val=
+ue=3D"1" name=3D"howmany"> images per page  
+								<input type=3D"submit" value=3D"change" style=3D"height:20;backgrou=
+nd-color:#ffffff;padding:0px" />
+                                        		</td>
+						</form>
+					</tr>
+					<tr><td align=3D"center">
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20021019"><img  src=3D"f=
+ile:///images/comics/showcomik.cgi?name=3Dnorm&date=3D20021019" border=3D"0=
+"></a>
+						<br><br>
+					</td></tr>
+				</table>				</td>=0D
+			</tr>=0D
+		</table>=0D
+	</body>=0D
+</html>=0D
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/index.cgi.eml.location b/t/ref/index.cgi.eml.location
new file mode 100644
index 0000000..096df5e
--- /dev/null
+++ b/t/ref/index.cgi.eml.location
@@ -0,0 +1,312 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Type: multipart/related; boundary="alian-mime-lite-html"
+
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+	<head>
+		<title>~kdz13.net</title>
+		<style>
+			.title_link {
+				color : #FFFFFF;
+				text-decoration: none;
+			}
+=09=09=09
+			.calend_link:active {
+				color : #FF0000;
+			}
+
+			.calend_link:visited {
+				color : #00BD00;
+				text-decoration: line-through;
+			}
+			.calend_link:hover {
+				color : #FF0000;
+				text-decoration: none;
+			}
+=09=09=09
+			.calend_link:link {
+				color : #000000;
+			}
+
+			.boring_link:active {
+                                color : #FF0000;
+                                text-decoration: none;
+                        }
+
+                        .boring_link:visited {
+                                color : #000000;
+                                text-decoration: none;
+                        }
+
+                        .boring_link:hover {
+                                color : #FF0000;
+                                text-decoration: none;
+                        }
+
+			.boring_link:link {
+				color : #000000;
+                                text-decoration: none;
+			}
+		</style>
+	</head>
+	<body topmargin=3D"0" leftmargin=3D"0" marginheight=3D"0" marginwidth=3D"0=
+">
+		<table cellpadding=3D"0" cellspacing=3D"0" border=3D"1" ID=3D"Table1">
+			<tr height=3D"65">
+				<td width=3D"175" align=3D"center" valign=3D"middle">
+					<a href=3D"file:///">~kdz13.net</a><br>
+				</td>
+				<td align=3D"center" valign=3D"middle">
+<table cellpadding=3D"0" cellspacing=3D"0" boroder=3D"0" width=3D"100%"><tr=
+><td align=3D"left"><a href=3D"file:///comics?name=3Dnorm"><img  border=3D"=
+0" src=3D"file:///images/norm.gif"></a></td></tr></table>				</td>
+			</tr>
+			<tr>
+				<td align=3D"left" valign=3D"top">
+					<a href=3D"file:///">~home</a><br>
+					<br>
+					<a href=3D"file:///comics">~comics</a><br>
+					<a href=3D"file:///spamalyzer">~spamalyzer</a>
+				</td>
+				<td>
+				<TABLE width=3D"100%" align=3D"center" border=3D"0" cellspacing=3D"1" c=
+ellpadding=3D"0" bgcolor=3D"#dddddd">
+					<TR><td valign=3D"top" align=3D"middle" colspan=3D"9" height=3D"26px" =
+width=3D"648px" style=3D
+						"color:#ffffff; background-repeat:no-repeat"  background=3D"file:///i=
+mages/bar.gif">
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20020919"><img  border=
+=3D"0" src=3D"file:///images/prev_month.gif"></a>
+							   
+							October 2002
+							   
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20021119"><img  border=
+=3D"0" src=3D"file:///images/next_month.gif"></a>
+					</td></TR>
+					<tr height=3D"0">
+						<td width=3D"29%" bgcolor=3D"#ffffff" rowspan=3D"8" border=3D"0">
+							<a class=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D2=
+0021018"><--previous day</a>
+						</td>
+						<td colspan=3D"7" bgcolor=3D"#ffffff" border=3D"0"></td>
+						<td width=3D"29%" align=3D"right" bgcolor=3D"#ffffff" rowspan=3D"8">
+							<a class=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D2=
+0021020">next day--></a>
+						</td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center"><cite> S </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> M </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> T </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> W </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> T </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> F </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> S </cite></TD>
+					</tr>
+				 	<tr height=3D"32">
+<td> </td><td> </td>						<td width=3D"35" align=3D"center" bgcol=
+or=3D"#ffffff"> <a class=3D"calend_link" href=3D"file:///comics?name=
+=3Dnorm&date=3D20021001"> 1</a> </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021002"> 2</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021003"> 3</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021004"> 4</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021005"> 5</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021006"> 6</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021007"> 7</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021008"> 8</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021009"> 9</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021010">10</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021011">11</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021012">12</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021013">13</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021014">14</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021015">15</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021016">16</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021017">17</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021018">18</a>=
+ </td>
+					<td align=3D"center" bgcolor=3D"#ffffff"> <B>19</B> </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021020">20</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021021">21</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021022">22</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021023">23</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021024">24</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021025">25</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021026">26</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021027">27</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021028">28</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021029">29</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021030">30</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021031">31</a>=
+ </td>
+<td> </td><td> </td>					</tr>
+				</TABLE><br>
+				<table width=3D"100%" border=3D"0" cellpadding=3D"0" cellspacing=3D"0">
+					<tr>
+						<form   action=3D"file:///comics?name=3Dnorm&date=3D20021019" method=
+=3D"GET" valign=3D"middle">
+							<td align=3D"center" valign=3D"middle" width=3D"100%" height=3D"26px=
+" style=3D
+	        		                                        "background-repeat:no-re=
+peat;color:#ffffff"  background=3D"file:///images/bar.gif">
+								<span style=3D"width:100px"></span>
+                        		                        <a href=3D"file:///comics=
+?name=3Dnorm&date=3D20021019&howmany=3D1" class=3D"title_link">The Norm</a>
+								<span style=3D"width:100px"></span>
+								<input type=3D"hidden" name=3D"name" value=3D"norm" />
+								<input type=3D"hidden" name=3D"date" value=3D"20021019" />
+								<input type=3D"text" align=3D"right" size=3D"2" maxlength=3D"3" val=
+ue=3D"1" name=3D"howmany"> images per page  
+								<input type=3D"submit" value=3D"change" style=3D"height:20;backgrou=
+nd-color:#ffffff;padding:0px" />
+                                        		</td>
+						</form>
+					</tr>
+					<tr><td align=3D"center">
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20021019"><img  src=3D"f=
+ile:///images/comics/showcomik.cgi?name=3Dnorm&date=3D20021019" border=3D"0=
+"></a>
+						<br><br>
+					</td></tr>
+				</table>				</td>=0D
+			</tr>=0D
+		</table>=0D
+	</body>=0D
+</html>=0D
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///images/norm.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///images/bar.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///images/prev_month.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///images/next_month.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///images/comics/showcomik.cgi?name=norm&date=20021019
+Content-Transfer-Encoding: base64
+Content-Type: application/x-shockwave-flash
+
+
+
+--alian-mime-lite-html--
+
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/index.cgi.eml2.cid b/t/ref/index.cgi.eml2.cid
new file mode 100644
index 0000000..dec30f4
--- /dev/null
+++ b/t/ref/index.cgi.eml2.cid
@@ -0,0 +1,296 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/related; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+	<head>
+		<title>~kdz13.net</title>
+		<style>
+			.title_link {
+				color : #FFFFFF;
+				text-decoration: none;
+			}
+=09=09=09
+			.calend_link:active {
+				color : #FF0000;
+			}
+
+			.calend_link:visited {
+				color : #00BD00;
+				text-decoration: line-through;
+			}
+			.calend_link:hover {
+				color : #FF0000;
+				text-decoration: none;
+			}
+=09=09=09
+			.calend_link:link {
+				color : #000000;
+			}
+
+			.boring_link:active {
+                                color : #FF0000;
+                                text-decoration: none;
+                        }
+
+                        .boring_link:visited {
+                                color : #000000;
+                                text-decoration: none;
+                        }
+
+                        .boring_link:hover {
+                                color : #FF0000;
+                                text-decoration: none;
+                        }
+
+			.boring_link:link {
+				color : #000000;
+                                text-decoration: none;
+			}
+		</style>
+	</head>
+	<body topmargin=3D"0" leftmargin=3D"0" marginheight=3D"0" marginwidth=3D"0=
+">
+		<table cellpadding=3D"0" cellspacing=3D"0" border=3D"1" ID=3D"Table1">
+			<tr height=3D"65">
+				<td width=3D"175" align=3D"center" valign=3D"middle">
+					<a href=3D"file:///">~kdz13.net</a><br>
+				</td>
+				<td align=3D"center" valign=3D"middle">
+<table cellpadding=3D"0" cellspacing=3D"0" boroder=3D"0" width=3D"100%"><tr=
+><td align=3D"left"><a href=3D"file:///comics?name=3Dnorm"><img  border=3D"=
+0" src=3D"cid:6e6f726d2e676966 at MIME-Lite-HTML-1.23"></a></td></tr></table>	=
+			</td>
+			</tr>
+			<tr>
+				<td align=3D"left" valign=3D"top">
+					<a href=3D"file:///">~home</a><br>
+					<br>
+					<a href=3D"file:///comics">~comics</a><br>
+					<a href=3D"file:///spamalyzer">~spamalyzer</a>
+				</td>
+				<td>
+				<TABLE width=3D"100%" align=3D"center" border=3D"0" cellspacing=3D"1" c=
+ellpadding=3D"0" bgcolor=3D"#dddddd">
+					<TR><td valign=3D"top" align=3D"middle" colspan=3D"9" height=3D"26px" =
+width=3D"648px" style=3D
+						"color:#ffffff; background-repeat:no-repeat"  background=3D"cid:f6261=
+722e676966 at MIME-Lite-HTML-1.23">
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20020919"><img  border=
+=3D"0" src=3D"cid:765f6d6f6e74682e676966 at MIME-Lite-HTML-1.23"></a>
+							   
+							October 2002
+							   
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20021119"><img  border=
+=3D"0" src=3D"cid:745f6d6f6e74682e676966 at MIME-Lite-HTML-1.23"></a>
+					</td></TR>
+					<tr height=3D"0">
+						<td width=3D"29%" bgcolor=3D"#ffffff" rowspan=3D"8" border=3D"0">
+							<a class=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D2=
+0021018"><--previous day</a>
+						</td>
+						<td colspan=3D"7" bgcolor=3D"#ffffff" border=3D"0"></td>
+						<td width=3D"29%" align=3D"right" bgcolor=3D"#ffffff" rowspan=3D"8">
+							<a class=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D2=
+0021020">next day--></a>
+						</td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center"><cite> S </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> M </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> T </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> W </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> T </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> F </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> S </cite></TD>
+					</tr>
+				 	<tr height=3D"32">
+<td> </td><td> </td>						<td width=3D"35" align=3D"center" bgcol=
+or=3D"#ffffff"> <a class=3D"calend_link" href=3D"file:///comics?name=
+=3Dnorm&date=3D20021001"> 1</a> </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021002"> 2</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021003"> 3</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021004"> 4</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021005"> 5</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021006"> 6</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021007"> 7</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021008"> 8</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021009"> 9</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021010">10</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021011">11</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021012">12</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021013">13</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021014">14</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021015">15</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021016">16</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021017">17</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021018">18</a>=
+ </td>
+					<td align=3D"center" bgcolor=3D"#ffffff"> <B>19</B> </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021020">20</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021021">21</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021022">22</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021023">23</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021024">24</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021025">25</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021026">26</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021027">27</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021028">28</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021029">29</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021030">30</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021031">31</a>=
+ </td>
+<td> </td><td> </td>					</tr>
+				</TABLE><br>
+				<table width=3D"100%" border=3D"0" cellpadding=3D"0" cellspacing=3D"0">
+					<tr>
+						<form   action=3D"file:///comics?name=3Dnorm&date=3D20021019" method=
+=3D"GET" valign=3D"middle">
+							<td align=3D"center" valign=3D"middle" width=3D"100%" height=3D"26px=
+" style=3D
+	        		                                        "background-repeat:no-re=
+peat;color:#ffffff"  background=3D"cid:f6261722e676966 at MIME-Lite-HTML-1.23">
+								<span style=3D"width:100px"></span>
+                        		                        <a href=3D"file:///comics=
+?name=3Dnorm&date=3D20021019&howmany=3D1" class=3D"title_link">The Norm</a>
+								<span style=3D"width:100px"></span>
+								<input type=3D"hidden" name=3D"name" value=3D"norm" />
+								<input type=3D"hidden" name=3D"date" value=3D"20021019" />
+								<input type=3D"text" align=3D"right" size=3D"2" maxlength=3D"3" val=
+ue=3D"1" name=3D"howmany"> images per page  
+								<input type=3D"submit" value=3D"change" style=3D"height:20;backgrou=
+nd-color:#ffffff;padding:0px" />
+                                        		</td>
+						</form>
+					</tr>
+					<tr><td align=3D"center">
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20021019"><img  src=3D"c=
+id:67693f6e616d653d6e6f726d26646174653d3230303231303139 at MIME-Lite-HTML-1.23=
+" border=3D"0"></a>
+						<br><br>
+					</td></tr>
+				</table>				</td>=0D
+			</tr>=0D
+		</table>=0D
+	</body>=0D
+</html>=0D
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <6e6f726d2e676966 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <f6261722e676966 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <765f6d6f6e74682e676966 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <745f6d6f6e74682e676966 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <67693f6e616d653d6e6f726d26646174653d3230303231303139 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: application/x-shockwave-flash
+
+
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/index.cgi.eml2.extern b/t/ref/index.cgi.eml2.extern
new file mode 100644
index 0000000..a65b066
--- /dev/null
+++ b/t/ref/index.cgi.eml2.extern
@@ -0,0 +1,244 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+<html>
+	<head>
+		<title>~kdz13.net</title>
+		<style>
+			.title_link {
+				color : #FFFFFF;
+				text-decoration: none;
+			}
+=09=09=09
+			.calend_link:active {
+				color : #FF0000;
+			}
+
+			.calend_link:visited {
+				color : #00BD00;
+				text-decoration: line-through;
+			}
+			.calend_link:hover {
+				color : #FF0000;
+				text-decoration: none;
+			}
+=09=09=09
+			.calend_link:link {
+				color : #000000;
+			}
+
+			.boring_link:active {
+                                color : #FF0000;
+                                text-decoration: none;
+                        }
+
+                        .boring_link:visited {
+                                color : #000000;
+                                text-decoration: none;
+                        }
+
+                        .boring_link:hover {
+                                color : #FF0000;
+                                text-decoration: none;
+                        }
+
+			.boring_link:link {
+				color : #000000;
+                                text-decoration: none;
+			}
+		</style>
+	</head>
+	<body topmargin=3D"0" leftmargin=3D"0" marginheight=3D"0" marginwidth=3D"0=
+">
+		<table cellpadding=3D"0" cellspacing=3D"0" border=3D"1" ID=3D"Table1">
+			<tr height=3D"65">
+				<td width=3D"175" align=3D"center" valign=3D"middle">
+					<a href=3D"file:///">~kdz13.net</a><br>
+				</td>
+				<td align=3D"center" valign=3D"middle">
+<table cellpadding=3D"0" cellspacing=3D"0" boroder=3D"0" width=3D"100%"><tr=
+><td align=3D"left"><a href=3D"file:///comics?name=3Dnorm"><img  border=3D"=
+0" src=3D"file:///images/norm.gif"></a></td></tr></table>				</td>
+			</tr>
+			<tr>
+				<td align=3D"left" valign=3D"top">
+					<a href=3D"file:///">~home</a><br>
+					<br>
+					<a href=3D"file:///comics">~comics</a><br>
+					<a href=3D"file:///spamalyzer">~spamalyzer</a>
+				</td>
+				<td>
+				<TABLE width=3D"100%" align=3D"center" border=3D"0" cellspacing=3D"1" c=
+ellpadding=3D"0" bgcolor=3D"#dddddd">
+					<TR><td valign=3D"top" align=3D"middle" colspan=3D"9" height=3D"26px" =
+width=3D"648px" style=3D
+						"color:#ffffff; background-repeat:no-repeat"  background=3D"file:///i=
+mages/bar.gif">
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20020919"><img  border=
+=3D"0" src=3D"file:///images/prev_month.gif"></a>
+							   
+							October 2002
+							   
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20021119"><img  border=
+=3D"0" src=3D"file:///images/next_month.gif"></a>
+					</td></TR>
+					<tr height=3D"0">
+						<td width=3D"29%" bgcolor=3D"#ffffff" rowspan=3D"8" border=3D"0">
+							<a class=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D2=
+0021018"><--previous day</a>
+						</td>
+						<td colspan=3D"7" bgcolor=3D"#ffffff" border=3D"0"></td>
+						<td width=3D"29%" align=3D"right" bgcolor=3D"#ffffff" rowspan=3D"8">
+							<a class=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D2=
+0021020">next day--></a>
+						</td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center"><cite> S </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> M </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> T </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> W </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> T </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> F </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> S </cite></TD>
+					</tr>
+				 	<tr height=3D"32">
+<td> </td><td> </td>						<td width=3D"35" align=3D"center" bgcol=
+or=3D"#ffffff"> <a class=3D"calend_link" href=3D"file:///comics?name=
+=3Dnorm&date=3D20021001"> 1</a> </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021002"> 2</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021003"> 3</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021004"> 4</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021005"> 5</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021006"> 6</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021007"> 7</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021008"> 8</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021009"> 9</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021010">10</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021011">11</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021012">12</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021013">13</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021014">14</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021015">15</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021016">16</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021017">17</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021018">18</a>=
+ </td>
+					<td align=3D"center" bgcolor=3D"#ffffff"> <B>19</B> </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021020">20</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021021">21</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021022">22</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021023">23</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021024">24</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021025">25</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021026">26</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021027">27</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021028">28</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021029">29</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021030">30</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021031">31</a>=
+ </td>
+<td> </td><td> </td>					</tr>
+				</TABLE><br>
+				<table width=3D"100%" border=3D"0" cellpadding=3D"0" cellspacing=3D"0">
+					<tr>
+						<form   action=3D"file:///comics?name=3Dnorm&date=3D20021019" method=
+=3D"GET" valign=3D"middle">
+							<td align=3D"center" valign=3D"middle" width=3D"100%" height=3D"26px=
+" style=3D
+	        		                                        "background-repeat:no-re=
+peat;color:#ffffff"  background=3D"file:///images/bar.gif">
+								<span style=3D"width:100px"></span>
+                        		                        <a href=3D"file:///comics=
+?name=3Dnorm&date=3D20021019&howmany=3D1" class=3D"title_link">The Norm</a>
+								<span style=3D"width:100px"></span>
+								<input type=3D"hidden" name=3D"name" value=3D"norm" />
+								<input type=3D"hidden" name=3D"date" value=3D"20021019" />
+								<input type=3D"text" align=3D"right" size=3D"2" maxlength=3D"3" val=
+ue=3D"1" name=3D"howmany"> images per page  
+								<input type=3D"submit" value=3D"change" style=3D"height:20;backgrou=
+nd-color:#ffffff;padding:0px" />
+                                        		</td>
+						</form>
+					</tr>
+					<tr><td align=3D"center">
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20021019"><img  src=3D"f=
+ile:///images/comics/showcomik.cgi?name=3Dnorm&date=3D20021019" border=3D"0=
+"></a>
+						<br><br>
+					</td></tr>
+				</table>				</td>=0D
+			</tr>=0D
+		</table>=0D
+	</body>=0D
+</html>=0D
diff --git a/t/ref/index.cgi.eml2.location b/t/ref/index.cgi.eml2.location
new file mode 100644
index 0000000..091ff12
--- /dev/null
+++ b/t/ref/index.cgi.eml2.location
@@ -0,0 +1,295 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/related; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+	<head>
+		<title>~kdz13.net</title>
+		<style>
+			.title_link {
+				color : #FFFFFF;
+				text-decoration: none;
+			}
+=09=09=09
+			.calend_link:active {
+				color : #FF0000;
+			}
+
+			.calend_link:visited {
+				color : #00BD00;
+				text-decoration: line-through;
+			}
+			.calend_link:hover {
+				color : #FF0000;
+				text-decoration: none;
+			}
+=09=09=09
+			.calend_link:link {
+				color : #000000;
+			}
+
+			.boring_link:active {
+                                color : #FF0000;
+                                text-decoration: none;
+                        }
+
+                        .boring_link:visited {
+                                color : #000000;
+                                text-decoration: none;
+                        }
+
+                        .boring_link:hover {
+                                color : #FF0000;
+                                text-decoration: none;
+                        }
+
+			.boring_link:link {
+				color : #000000;
+                                text-decoration: none;
+			}
+		</style>
+	</head>
+	<body topmargin=3D"0" leftmargin=3D"0" marginheight=3D"0" marginwidth=3D"0=
+">
+		<table cellpadding=3D"0" cellspacing=3D"0" border=3D"1" ID=3D"Table1">
+			<tr height=3D"65">
+				<td width=3D"175" align=3D"center" valign=3D"middle">
+					<a href=3D"file:///">~kdz13.net</a><br>
+				</td>
+				<td align=3D"center" valign=3D"middle">
+<table cellpadding=3D"0" cellspacing=3D"0" boroder=3D"0" width=3D"100%"><tr=
+><td align=3D"left"><a href=3D"file:///comics?name=3Dnorm"><img  border=3D"=
+0" src=3D"file:///images/norm.gif"></a></td></tr></table>				</td>
+			</tr>
+			<tr>
+				<td align=3D"left" valign=3D"top">
+					<a href=3D"file:///">~home</a><br>
+					<br>
+					<a href=3D"file:///comics">~comics</a><br>
+					<a href=3D"file:///spamalyzer">~spamalyzer</a>
+				</td>
+				<td>
+				<TABLE width=3D"100%" align=3D"center" border=3D"0" cellspacing=3D"1" c=
+ellpadding=3D"0" bgcolor=3D"#dddddd">
+					<TR><td valign=3D"top" align=3D"middle" colspan=3D"9" height=3D"26px" =
+width=3D"648px" style=3D
+						"color:#ffffff; background-repeat:no-repeat"  background=3D"file:///i=
+mages/bar.gif">
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20020919"><img  border=
+=3D"0" src=3D"file:///images/prev_month.gif"></a>
+							   
+							October 2002
+							   
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20021119"><img  border=
+=3D"0" src=3D"file:///images/next_month.gif"></a>
+					</td></TR>
+					<tr height=3D"0">
+						<td width=3D"29%" bgcolor=3D"#ffffff" rowspan=3D"8" border=3D"0">
+							<a class=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D2=
+0021018"><--previous day</a>
+						</td>
+						<td colspan=3D"7" bgcolor=3D"#ffffff" border=3D"0"></td>
+						<td width=3D"29%" align=3D"right" bgcolor=3D"#ffffff" rowspan=3D"8">
+							<a class=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D2=
+0021020">next day--></a>
+						</td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center"><cite> S </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> M </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> T </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> W </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> T </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> F </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> S </cite></TD>
+					</tr>
+				 	<tr height=3D"32">
+<td> </td><td> </td>						<td width=3D"35" align=3D"center" bgcol=
+or=3D"#ffffff"> <a class=3D"calend_link" href=3D"file:///comics?name=
+=3Dnorm&date=3D20021001"> 1</a> </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021002"> 2</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021003"> 3</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021004"> 4</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021005"> 5</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021006"> 6</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021007"> 7</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021008"> 8</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021009"> 9</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021010">10</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021011">11</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021012">12</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021013">13</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021014">14</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021015">15</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021016">16</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021017">17</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021018">18</a>=
+ </td>
+					<td align=3D"center" bgcolor=3D"#ffffff"> <B>19</B> </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021020">20</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021021">21</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021022">22</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021023">23</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021024">24</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021025">25</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021026">26</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021027">27</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021028">28</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021029">29</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021030">30</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021031">31</a>=
+ </td>
+<td> </td><td> </td>					</tr>
+				</TABLE><br>
+				<table width=3D"100%" border=3D"0" cellpadding=3D"0" cellspacing=3D"0">
+					<tr>
+						<form   action=3D"file:///comics?name=3Dnorm&date=3D20021019" method=
+=3D"GET" valign=3D"middle">
+							<td align=3D"center" valign=3D"middle" width=3D"100%" height=3D"26px=
+" style=3D
+	        		                                        "background-repeat:no-re=
+peat;color:#ffffff"  background=3D"file:///images/bar.gif">
+								<span style=3D"width:100px"></span>
+                        		                        <a href=3D"file:///comics=
+?name=3Dnorm&date=3D20021019&howmany=3D1" class=3D"title_link">The Norm</a>
+								<span style=3D"width:100px"></span>
+								<input type=3D"hidden" name=3D"name" value=3D"norm" />
+								<input type=3D"hidden" name=3D"date" value=3D"20021019" />
+								<input type=3D"text" align=3D"right" size=3D"2" maxlength=3D"3" val=
+ue=3D"1" name=3D"howmany"> images per page  
+								<input type=3D"submit" value=3D"change" style=3D"height:20;backgrou=
+nd-color:#ffffff;padding:0px" />
+                                        		</td>
+						</form>
+					</tr>
+					<tr><td align=3D"center">
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20021019"><img  src=3D"f=
+ile:///images/comics/showcomik.cgi?name=3Dnorm&date=3D20021019" border=3D"0=
+"></a>
+						<br><br>
+					</td></tr>
+				</table>				</td>=0D
+			</tr>=0D
+		</table>=0D
+	</body>=0D
+</html>=0D
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///images/norm.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///images/bar.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///images/prev_month.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///images/next_month.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///images/comics/showcomik.cgi?name=norm&date=20021019
+Content-Transfer-Encoding: base64
+Content-Type: application/x-shockwave-flash
+
+
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/index.cgi.eml3.cid b/t/ref/index.cgi.eml3.cid
new file mode 100644
index 0000000..0729bd6
--- /dev/null
+++ b/t/ref/index.cgi.eml3.cid
@@ -0,0 +1,414 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Type: multipart/related; boundary="alian-mime-lite-html"
+
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+	<head>
+		<title>~kdz13.net</title>
+		<style>
+			.title_link {
+				color : #FFFFFF;
+				text-decoration: none;
+			}
+=09=09=09
+			.calend_link:active {
+				color : #FF0000;
+			}
+
+			.calend_link:visited {
+				color : #00BD00;
+				text-decoration: line-through;
+			}
+			.calend_link:hover {
+				color : #FF0000;
+				text-decoration: none;
+			}
+=09=09=09
+			.calend_link:link {
+				color : #000000;
+			}
+
+			.boring_link:active {
+                                color : #FF0000;
+                                text-decoration: none;
+                        }
+
+                        .boring_link:visited {
+                                color : #000000;
+                                text-decoration: none;
+                        }
+
+                        .boring_link:hover {
+                                color : #FF0000;
+                                text-decoration: none;
+                        }
+
+			.boring_link:link {
+				color : #000000;
+                                text-decoration: none;
+			}
+		</style>
+	</head>
+	<body topmargin=3D"0" leftmargin=3D"0" marginheight=3D"0" marginwidth=3D"0=
+">
+		<table cellpadding=3D"0" cellspacing=3D"0" border=3D"1" ID=3D"Table1">
+			<tr height=3D"65">
+				<td width=3D"175" align=3D"center" valign=3D"middle">
+					<a href=3D"file:///">~kdz13.net</a><br>
+				</td>
+				<td align=3D"center" valign=3D"middle">
+<table cellpadding=3D"0" cellspacing=3D"0" boroder=3D"0" width=3D"100%"><tr=
+><td align=3D"left"><a href=3D"file:///comics?name=3Dnorm"><img  border=3D"=
+0" src=3D"cid:6e6f726d2e676966 at MIME-Lite-HTML-1.23"></a></td></tr></table>	=
+			</td>
+			</tr>
+			<tr>
+				<td align=3D"left" valign=3D"top">
+					<a href=3D"file:///">~home</a><br>
+					<br>
+					<a href=3D"file:///comics">~comics</a><br>
+					<a href=3D"file:///spamalyzer">~spamalyzer</a>
+				</td>
+				<td>
+				<TABLE width=3D"100%" align=3D"center" border=3D"0" cellspacing=3D"1" c=
+ellpadding=3D"0" bgcolor=3D"#dddddd">
+					<TR><td valign=3D"top" align=3D"middle" colspan=3D"9" height=3D"26px" =
+width=3D"648px" style=3D
+						"color:#ffffff; background-repeat:no-repeat"  background=3D"cid:f6261=
+722e676966 at MIME-Lite-HTML-1.23">
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20020919"><img  border=
+=3D"0" src=3D"cid:765f6d6f6e74682e676966 at MIME-Lite-HTML-1.23"></a>
+							   
+							October 2002
+							   
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20021119"><img  border=
+=3D"0" src=3D"cid:745f6d6f6e74682e676966 at MIME-Lite-HTML-1.23"></a>
+					</td></TR>
+					<tr height=3D"0">
+						<td width=3D"29%" bgcolor=3D"#ffffff" rowspan=3D"8" border=3D"0">
+							<a class=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D2=
+0021018"><--previous day</a>
+						</td>
+						<td colspan=3D"7" bgcolor=3D"#ffffff" border=3D"0"></td>
+						<td width=3D"29%" align=3D"right" bgcolor=3D"#ffffff" rowspan=3D"8">
+							<a class=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D2=
+0021020">next day--></a>
+						</td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center"><cite> S </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> M </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> T </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> W </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> T </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> F </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> S </cite></TD>
+					</tr>
+				 	<tr height=3D"32">
+<td> </td><td> </td>						<td width=3D"35" align=3D"center" bgcol=
+or=3D"#ffffff"> <a class=3D"calend_link" href=3D"file:///comics?name=
+=3Dnorm&date=3D20021001"> 1</a> </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021002"> 2</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021003"> 3</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021004"> 4</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021005"> 5</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021006"> 6</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021007"> 7</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021008"> 8</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021009"> 9</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021010">10</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021011">11</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021012">12</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021013">13</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021014">14</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021015">15</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021016">16</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021017">17</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021018">18</a>=
+ </td>
+					<td align=3D"center" bgcolor=3D"#ffffff"> <B>19</B> </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021020">20</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021021">21</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021022">22</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021023">23</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021024">24</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021025">25</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021026">26</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021027">27</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021028">28</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021029">29</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021030">30</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021031">31</a>=
+ </td>
+<td> </td><td> </td>					</tr>
+				</TABLE><br>
+				<table width=3D"100%" border=3D"0" cellpadding=3D"0" cellspacing=3D"0">
+					<tr>
+						<form   action=3D"file:///comics?name=3Dnorm&date=3D20021019" method=
+=3D"GET" valign=3D"middle">
+							<td align=3D"center" valign=3D"middle" width=3D"100%" height=3D"26px=
+" style=3D
+	        		                                        "background-repeat:no-re=
+peat;color:#ffffff"  background=3D"cid:f6261722e676966 at MIME-Lite-HTML-1.23">
+								<span style=3D"width:100px"></span>
+                        		                        <a href=3D"file:///comics=
+?name=3Dnorm&date=3D20021019&howmany=3D1" class=3D"title_link">The Norm</a>
+								<span style=3D"width:100px"></span>
+								<input type=3D"hidden" name=3D"name" value=3D"norm" />
+								<input type=3D"hidden" name=3D"date" value=3D"20021019" />
+								<input type=3D"text" align=3D"right" size=3D"2" maxlength=3D"3" val=
+ue=3D"1" name=3D"howmany"> images per page  
+								<input type=3D"submit" value=3D"change" style=3D"height:20;backgrou=
+nd-color:#ffffff;padding:0px" />
+                                        		</td>
+						</form>
+					</tr>
+					<tr><td align=3D"center">
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20021019"><img  src=3D"c=
+id:67693f6e616d653d6e6f726d26646174653d3230303231303139 at MIME-Lite-HTML-1.23=
+" border=3D"0"></a>
+						<br><br>
+					</td></tr>
+				</table>				</td>=0D
+			</tr>=0D
+		</table>=0D
+	</body>=0D
+</html>=0D
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <6e6f726d2e676966 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <f6261722e676966 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <765f6d6f6e74682e676966 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <745f6d6f6e74682e676966 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <67693f6e616d653d6e6f726d26646174653d3230303231303139 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: application/x-shockwave-flash
+
+
+
+--alian-mime-lite-html--
+
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/index.cgi.eml3.extern b/t/ref/index.cgi.eml3.extern
new file mode 100644
index 0000000..6852c53
--- /dev/null
+++ b/t/ref/index.cgi.eml3.extern
@@ -0,0 +1,363 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+	<head>
+		<title>~kdz13.net</title>
+		<style>
+			.title_link {
+				color : #FFFFFF;
+				text-decoration: none;
+			}
+=09=09=09
+			.calend_link:active {
+				color : #FF0000;
+			}
+
+			.calend_link:visited {
+				color : #00BD00;
+				text-decoration: line-through;
+			}
+			.calend_link:hover {
+				color : #FF0000;
+				text-decoration: none;
+			}
+=09=09=09
+			.calend_link:link {
+				color : #000000;
+			}
+
+			.boring_link:active {
+                                color : #FF0000;
+                                text-decoration: none;
+                        }
+
+                        .boring_link:visited {
+                                color : #000000;
+                                text-decoration: none;
+                        }
+
+                        .boring_link:hover {
+                                color : #FF0000;
+                                text-decoration: none;
+                        }
+
+			.boring_link:link {
+				color : #000000;
+                                text-decoration: none;
+			}
+		</style>
+	</head>
+	<body topmargin=3D"0" leftmargin=3D"0" marginheight=3D"0" marginwidth=3D"0=
+">
+		<table cellpadding=3D"0" cellspacing=3D"0" border=3D"1" ID=3D"Table1">
+			<tr height=3D"65">
+				<td width=3D"175" align=3D"center" valign=3D"middle">
+					<a href=3D"file:///">~kdz13.net</a><br>
+				</td>
+				<td align=3D"center" valign=3D"middle">
+<table cellpadding=3D"0" cellspacing=3D"0" boroder=3D"0" width=3D"100%"><tr=
+><td align=3D"left"><a href=3D"file:///comics?name=3Dnorm"><img  border=3D"=
+0" src=3D"file:///images/norm.gif"></a></td></tr></table>				</td>
+			</tr>
+			<tr>
+				<td align=3D"left" valign=3D"top">
+					<a href=3D"file:///">~home</a><br>
+					<br>
+					<a href=3D"file:///comics">~comics</a><br>
+					<a href=3D"file:///spamalyzer">~spamalyzer</a>
+				</td>
+				<td>
+				<TABLE width=3D"100%" align=3D"center" border=3D"0" cellspacing=3D"1" c=
+ellpadding=3D"0" bgcolor=3D"#dddddd">
+					<TR><td valign=3D"top" align=3D"middle" colspan=3D"9" height=3D"26px" =
+width=3D"648px" style=3D
+						"color:#ffffff; background-repeat:no-repeat"  background=3D"file:///i=
+mages/bar.gif">
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20020919"><img  border=
+=3D"0" src=3D"file:///images/prev_month.gif"></a>
+							   
+							October 2002
+							   
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20021119"><img  border=
+=3D"0" src=3D"file:///images/next_month.gif"></a>
+					</td></TR>
+					<tr height=3D"0">
+						<td width=3D"29%" bgcolor=3D"#ffffff" rowspan=3D"8" border=3D"0">
+							<a class=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D2=
+0021018"><--previous day</a>
+						</td>
+						<td colspan=3D"7" bgcolor=3D"#ffffff" border=3D"0"></td>
+						<td width=3D"29%" align=3D"right" bgcolor=3D"#ffffff" rowspan=3D"8">
+							<a class=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D2=
+0021020">next day--></a>
+						</td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center"><cite> S </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> M </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> T </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> W </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> T </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> F </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> S </cite></TD>
+					</tr>
+				 	<tr height=3D"32">
+<td> </td><td> </td>						<td width=3D"35" align=3D"center" bgcol=
+or=3D"#ffffff"> <a class=3D"calend_link" href=3D"file:///comics?name=
+=3Dnorm&date=3D20021001"> 1</a> </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021002"> 2</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021003"> 3</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021004"> 4</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021005"> 5</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021006"> 6</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021007"> 7</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021008"> 8</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021009"> 9</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021010">10</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021011">11</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021012">12</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021013">13</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021014">14</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021015">15</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021016">16</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021017">17</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021018">18</a>=
+ </td>
+					<td align=3D"center" bgcolor=3D"#ffffff"> <B>19</B> </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021020">20</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021021">21</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021022">22</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021023">23</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021024">24</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021025">25</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021026">26</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021027">27</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021028">28</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021029">29</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021030">30</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021031">31</a>=
+ </td>
+<td> </td><td> </td>					</tr>
+				</TABLE><br>
+				<table width=3D"100%" border=3D"0" cellpadding=3D"0" cellspacing=3D"0">
+					<tr>
+						<form   action=3D"file:///comics?name=3Dnorm&date=3D20021019" method=
+=3D"GET" valign=3D"middle">
+							<td align=3D"center" valign=3D"middle" width=3D"100%" height=3D"26px=
+" style=3D
+	        		                                        "background-repeat:no-re=
+peat;color:#ffffff"  background=3D"file:///images/bar.gif">
+								<span style=3D"width:100px"></span>
+                        		                        <a href=3D"file:///comics=
+?name=3Dnorm&date=3D20021019&howmany=3D1" class=3D"title_link">The Norm</a>
+								<span style=3D"width:100px"></span>
+								<input type=3D"hidden" name=3D"name" value=3D"norm" />
+								<input type=3D"hidden" name=3D"date" value=3D"20021019" />
+								<input type=3D"text" align=3D"right" size=3D"2" maxlength=3D"3" val=
+ue=3D"1" name=3D"howmany"> images per page  
+								<input type=3D"submit" value=3D"change" style=3D"height:20;backgrou=
+nd-color:#ffffff;padding:0px" />
+                                        		</td>
+						</form>
+					</tr>
+					<tr><td align=3D"center">
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20021019"><img  src=3D"f=
+ile:///images/comics/showcomik.cgi?name=3Dnorm&date=3D20021019" border=3D"0=
+"></a>
+						<br><br>
+					</td></tr>
+				</table>				</td>=0D
+			</tr>=0D
+		</table>=0D
+	</body>=0D
+</html>=0D
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/index.cgi.eml3.location b/t/ref/index.cgi.eml3.location
new file mode 100644
index 0000000..9abaac3
--- /dev/null
+++ b/t/ref/index.cgi.eml3.location
@@ -0,0 +1,413 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Type: multipart/related; boundary="alian-mime-lite-html"
+
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+	<head>
+		<title>~kdz13.net</title>
+		<style>
+			.title_link {
+				color : #FFFFFF;
+				text-decoration: none;
+			}
+=09=09=09
+			.calend_link:active {
+				color : #FF0000;
+			}
+
+			.calend_link:visited {
+				color : #00BD00;
+				text-decoration: line-through;
+			}
+			.calend_link:hover {
+				color : #FF0000;
+				text-decoration: none;
+			}
+=09=09=09
+			.calend_link:link {
+				color : #000000;
+			}
+
+			.boring_link:active {
+                                color : #FF0000;
+                                text-decoration: none;
+                        }
+
+                        .boring_link:visited {
+                                color : #000000;
+                                text-decoration: none;
+                        }
+
+                        .boring_link:hover {
+                                color : #FF0000;
+                                text-decoration: none;
+                        }
+
+			.boring_link:link {
+				color : #000000;
+                                text-decoration: none;
+			}
+		</style>
+	</head>
+	<body topmargin=3D"0" leftmargin=3D"0" marginheight=3D"0" marginwidth=3D"0=
+">
+		<table cellpadding=3D"0" cellspacing=3D"0" border=3D"1" ID=3D"Table1">
+			<tr height=3D"65">
+				<td width=3D"175" align=3D"center" valign=3D"middle">
+					<a href=3D"file:///">~kdz13.net</a><br>
+				</td>
+				<td align=3D"center" valign=3D"middle">
+<table cellpadding=3D"0" cellspacing=3D"0" boroder=3D"0" width=3D"100%"><tr=
+><td align=3D"left"><a href=3D"file:///comics?name=3Dnorm"><img  border=3D"=
+0" src=3D"file:///images/norm.gif"></a></td></tr></table>				</td>
+			</tr>
+			<tr>
+				<td align=3D"left" valign=3D"top">
+					<a href=3D"file:///">~home</a><br>
+					<br>
+					<a href=3D"file:///comics">~comics</a><br>
+					<a href=3D"file:///spamalyzer">~spamalyzer</a>
+				</td>
+				<td>
+				<TABLE width=3D"100%" align=3D"center" border=3D"0" cellspacing=3D"1" c=
+ellpadding=3D"0" bgcolor=3D"#dddddd">
+					<TR><td valign=3D"top" align=3D"middle" colspan=3D"9" height=3D"26px" =
+width=3D"648px" style=3D
+						"color:#ffffff; background-repeat:no-repeat"  background=3D"file:///i=
+mages/bar.gif">
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20020919"><img  border=
+=3D"0" src=3D"file:///images/prev_month.gif"></a>
+							   
+							October 2002
+							   
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20021119"><img  border=
+=3D"0" src=3D"file:///images/next_month.gif"></a>
+					</td></TR>
+					<tr height=3D"0">
+						<td width=3D"29%" bgcolor=3D"#ffffff" rowspan=3D"8" border=3D"0">
+							<a class=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D2=
+0021018"><--previous day</a>
+						</td>
+						<td colspan=3D"7" bgcolor=3D"#ffffff" border=3D"0"></td>
+						<td width=3D"29%" align=3D"right" bgcolor=3D"#ffffff" rowspan=3D"8">
+							<a class=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D2=
+0021020">next day--></a>
+						</td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center"><cite> S </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> M </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> T </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> W </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> T </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> F </cite></TD>
+						<td width=3D"35" align=3D"center"><cite> S </cite></TD>
+					</tr>
+				 	<tr height=3D"32">
+<td> </td><td> </td>						<td width=3D"35" align=3D"center" bgcol=
+or=3D"#ffffff"> <a class=3D"calend_link" href=3D"file:///comics?name=
+=3Dnorm&date=3D20021001"> 1</a> </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021002"> 2</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021003"> 3</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021004"> 4</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021005"> 5</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021006"> 6</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021007"> 7</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021008"> 8</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021009"> 9</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021010">10</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021011">11</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021012">12</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021013">13</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021014">14</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021015">15</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021016">16</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021017">17</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021018">18</a>=
+ </td>
+					<td align=3D"center" bgcolor=3D"#ffffff"> <B>19</B> </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021020">20</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021021">21</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021022">22</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021023">23</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021024">24</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021025">25</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021026">26</a>=
+ </td>
+					</tr>
+				 	<tr height=3D"32">
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021027">27</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021028">28</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021029">29</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021030">30</a>=
+ </td>
+						<td width=3D"35" align=3D"center" bgcolor=3D"#ffffff"> <a class=
+=3D"calend_link" href=3D"file:///comics?name=3Dnorm&date=3D20021031">31</a>=
+ </td>
+<td> </td><td> </td>					</tr>
+				</TABLE><br>
+				<table width=3D"100%" border=3D"0" cellpadding=3D"0" cellspacing=3D"0">
+					<tr>
+						<form   action=3D"file:///comics?name=3Dnorm&date=3D20021019" method=
+=3D"GET" valign=3D"middle">
+							<td align=3D"center" valign=3D"middle" width=3D"100%" height=3D"26px=
+" style=3D
+	        		                                        "background-repeat:no-re=
+peat;color:#ffffff"  background=3D"file:///images/bar.gif">
+								<span style=3D"width:100px"></span>
+                        		                        <a href=3D"file:///comics=
+?name=3Dnorm&date=3D20021019&howmany=3D1" class=3D"title_link">The Norm</a>
+								<span style=3D"width:100px"></span>
+								<input type=3D"hidden" name=3D"name" value=3D"norm" />
+								<input type=3D"hidden" name=3D"date" value=3D"20021019" />
+								<input type=3D"text" align=3D"right" size=3D"2" maxlength=3D"3" val=
+ue=3D"1" name=3D"howmany"> images per page  
+								<input type=3D"submit" value=3D"change" style=3D"height:20;backgrou=
+nd-color:#ffffff;padding:0px" />
+                                        		</td>
+						</form>
+					</tr>
+					<tr><td align=3D"center">
+						<a href=3D"file:///comics?name=3Dnorm&date=3D20021019"><img  src=3D"f=
+ile:///images/comics/showcomik.cgi?name=3Dnorm&date=3D20021019" border=3D"0=
+"></a>
+						<br><br>
+					</td></tr>
+				</table>				</td>=0D
+			</tr>=0D
+		</table>=0D
+	</body>=0D
+</html>=0D
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///images/norm.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///images/bar.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///images/prev_month.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///images/next_month.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///images/comics/showcomik.cgi?name=norm&date=20021019
+Content-Transfer-Encoding: base64
+Content-Type: application/x-shockwave-flash
+
+
+
+--alian-mime-lite-html--
+
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/normal.eml.cid b/t/ref/normal.eml.cid
new file mode 100644
index 0000000..dc0291b
--- /dev/null
+++ b/t/ref/normal.eml.cid
@@ -0,0 +1,244 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Type: multipart/related; boundary="alian-mime-lite-html"
+
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+	<img  src=3D"cid:57374732f646f63732f696d672f736f6d6d616972652e676966 at MIME-=
+Lite-HTML-1.23" alt=3D"Alian" border=3D"0">
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"javascript:alert('http://validator.alianet');">Validator=
+ HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <57374732f646f63732f696d672f736f6d6d616972652e676966 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+R0lGODlhMgAyANX/AP///9b//87//8b//8bv773n57X//7Xv77XW1q3//63OzqXGxpzv75zGxpy1
+tZT3/5StrYylpYT3/3v3/3uUlHP3/3OMjGulpWuEhGNzc1qMjFpra1JjY8DAwEpjY0pSUjlKSjk5
+OTFCQik5OSEpKRghIRgYGADn9wDe7wDO3gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAB0ALAAAAAAyADIAQAb/wI5w
+SCwaj8ikcslsOlUAg3RKraqcz4B2y+16v2BwInXtqMLotDowGJfPWozqE8A4Ao5RQEVYkOoYe31/
+GIF0GYEiC4IBGRANHhpkQiqVlpeYmZqbnJZYn6ChoqBnKaanqKmqKKytrKqwp29rtLVsbpRaDhwY
+ELZqKgVfbZNmAcIFi1p9BL/HBQTCXwQNBbij2Nna29zZnZfdRlAn5OXm5+Zl23DO7V3X7O7tAsSz
+8vL1uffz+cYLJc0Q7KPV78wCgXUscLCg5Y9BEYD2BFgAsRCCiokWwQFBIcCBC8XiDazVL5zJkyhT
+qlzJsqXLl0OgAJhJsyZNdSehTJDwoILPwJ8+H0yoMKEoznUAXCldujRTiG+ZciWYSrWq1atYqW7J
+OjWkLQMjtcALu2aAWbNjydKil1atGrZe3b4tKLds27ph6BYwoQWEWmld4NojUULBMkQhEPxTUIIC
+BhIKFjd+bHhDBhEKCoRY8C8DCQIcMoBg4LVZAAQlIijScsZgiIiuIzqIsCHQZokBIArOteCDAwcg
+opFwYEeBCgUYTCgAAcLB8eTLQRinAOIDagwLjp82QWJ0XLxgdhsDH74kTCVBAAA7
+
+--alian-mime-lite-html--
+
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/normal.eml.extern b/t/ref/normal.eml.extern
new file mode 100644
index 0000000..f1a3f94
--- /dev/null
+++ b/t/ref/normal.eml.extern
@@ -0,0 +1,214 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"javascript:alert('http://validator.alianet');">Validator=
+ HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/normal.eml.location b/t/ref/normal.eml.location
new file mode 100644
index 0000000..b5bfbdc
--- /dev/null
+++ b/t/ref/normal.eml.location
@@ -0,0 +1,244 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Type: multipart/related; boundary="alian-mime-lite-html"
+
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"javascript:alert('http://validator.alianet');">Validator=
+ HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+R0lGODlhMgAyANX/AP///9b//87//8b//8bv773n57X//7Xv77XW1q3//63OzqXGxpzv75zGxpy1
+tZT3/5StrYylpYT3/3v3/3uUlHP3/3OMjGulpWuEhGNzc1qMjFpra1JjY8DAwEpjY0pSUjlKSjk5
+OTFCQik5OSEpKRghIRgYGADn9wDe7wDO3gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAB0ALAAAAAAyADIAQAb/wI5w
+SCwaj8ikcslsOlUAg3RKraqcz4B2y+16v2BwInXtqMLotDowGJfPWozqE8A4Ao5RQEVYkOoYe31/
+GIF0GYEiC4IBGRANHhpkQiqVlpeYmZqbnJZYn6ChoqBnKaanqKmqKKytrKqwp29rtLVsbpRaDhwY
+ELZqKgVfbZNmAcIFi1p9BL/HBQTCXwQNBbij2Nna29zZnZfdRlAn5OXm5+Zl23DO7V3X7O7tAsSz
+8vL1uffz+cYLJc0Q7KPV78wCgXUscLCg5Y9BEYD2BFgAsRCCiokWwQFBIcCBC8XiDazVL5zJkyhT
+qlzJsqXLl0OgAJhJsyZNdSehTJDwoILPwJ8+H0yoMKEoznUAXCldujRTiG+ZciWYSrWq1atYqW7J
+OjWkLQMjtcALu2aAWbNjydKil1atGrZe3b4tKLds27ph6BYwoQWEWmld4NojUULBMkQhEPxTUIIC
+BhIKFjd+bHhDBhEKCoRY8C8DCQIcMoBg4LVZAAQlIijScsZgiIiuIzqIsCHQZokBIArOteCDAwcg
+opFwYEeBCgUYTCgAAcLB8eTLQRinAOIDagwLjp82QWJ0XLxgdhsDH74kTCVBAAA7
+
+--alian-mime-lite-html--
+
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/normal.eml2.cid b/t/ref/normal.eml2.cid
new file mode 100644
index 0000000..2284be6
--- /dev/null
+++ b/t/ref/normal.eml2.cid
@@ -0,0 +1,227 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/related; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+	<img  src=3D"cid:57374732f646f63732f696d672f736f6d6d616972652e676966 at MIME-=
+Lite-HTML-1.23" alt=3D"Alian" border=3D"0">
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"javascript:alert('http://validator.alianet');">Validator=
+ HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <57374732f646f63732f696d672f736f6d6d616972652e676966 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+R0lGODlhMgAyANX/AP///9b//87//8b//8bv773n57X//7Xv77XW1q3//63OzqXGxpzv75zGxpy1
+tZT3/5StrYylpYT3/3v3/3uUlHP3/3OMjGulpWuEhGNzc1qMjFpra1JjY8DAwEpjY0pSUjlKSjk5
+OTFCQik5OSEpKRghIRgYGADn9wDe7wDO3gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAB0ALAAAAAAyADIAQAb/wI5w
+SCwaj8ikcslsOlUAg3RKraqcz4B2y+16v2BwInXtqMLotDowGJfPWozqE8A4Ao5RQEVYkOoYe31/
+GIF0GYEiC4IBGRANHhpkQiqVlpeYmZqbnJZYn6ChoqBnKaanqKmqKKytrKqwp29rtLVsbpRaDhwY
+ELZqKgVfbZNmAcIFi1p9BL/HBQTCXwQNBbij2Nna29zZnZfdRlAn5OXm5+Zl23DO7V3X7O7tAsSz
+8vL1uffz+cYLJc0Q7KPV78wCgXUscLCg5Y9BEYD2BFgAsRCCiokWwQFBIcCBC8XiDazVL5zJkyhT
+qlzJsqXLl0OgAJhJsyZNdSehTJDwoILPwJ8+H0yoMKEoznUAXCldujRTiG+ZciWYSrWq1atYqW7J
+OjWkLQMjtcALu2aAWbNjydKil1atGrZe3b4tKLds27ph6BYwoQWEWmld4NojUULBMkQhEPxTUIIC
+BhIKFjd+bHhDBhEKCoRY8C8DCQIcMoBg4LVZAAQlIijScsZgiIiuIzqIsCHQZokBIArOteCDAwcg
+opFwYEeBCgUYTCgAAcLB8eTLQRinAOIDagwLjp82QWJ0XLxgdhsDH74kTCVBAAA7
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/normal.eml2.extern b/t/ref/normal.eml2.extern
new file mode 100644
index 0000000..98d8c49
--- /dev/null
+++ b/t/ref/normal.eml2.extern
@@ -0,0 +1,196 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"javascript:alert('http://validator.alianet');">Validator=
+ HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
diff --git a/t/ref/normal.eml2.location b/t/ref/normal.eml2.location
new file mode 100644
index 0000000..eaee1dc
--- /dev/null
+++ b/t/ref/normal.eml2.location
@@ -0,0 +1,227 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/related; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"javascript:alert('http://validator.alianet');">Validator=
+ HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+R0lGODlhMgAyANX/AP///9b//87//8b//8bv773n57X//7Xv77XW1q3//63OzqXGxpzv75zGxpy1
+tZT3/5StrYylpYT3/3v3/3uUlHP3/3OMjGulpWuEhGNzc1qMjFpra1JjY8DAwEpjY0pSUjlKSjk5
+OTFCQik5OSEpKRghIRgYGADn9wDe7wDO3gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAB0ALAAAAAAyADIAQAb/wI5w
+SCwaj8ikcslsOlUAg3RKraqcz4B2y+16v2BwInXtqMLotDowGJfPWozqE8A4Ao5RQEVYkOoYe31/
+GIF0GYEiC4IBGRANHhpkQiqVlpeYmZqbnJZYn6ChoqBnKaanqKmqKKytrKqwp29rtLVsbpRaDhwY
+ELZqKgVfbZNmAcIFi1p9BL/HBQTCXwQNBbij2Nna29zZnZfdRlAn5OXm5+Zl23DO7V3X7O7tAsSz
+8vL1uffz+cYLJc0Q7KPV78wCgXUscLCg5Y9BEYD2BFgAsRCCiokWwQFBIcCBC8XiDazVL5zJkyhT
+qlzJsqXLl0OgAJhJsyZNdSehTJDwoILPwJ8+H0yoMKEoznUAXCldujRTiG+ZciWYSrWq1atYqW7J
+OjWkLQMjtcALu2aAWbNjydKil1atGrZe3b4tKLds27ph6BYwoQWEWmld4NojUULBMkQhEPxTUIIC
+BhIKFjd+bHhDBhEKCoRY8C8DCQIcMoBg4LVZAAQlIijScsZgiIiuIzqIsCHQZokBIArOteCDAwcg
+opFwYEeBCgUYTCgAAcLB8eTLQRinAOIDagwLjp82QWJ0XLxgdhsDH74kTCVBAAA7
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/normal.eml3.cid b/t/ref/normal.eml3.cid
new file mode 100644
index 0000000..0d3992c
--- /dev/null
+++ b/t/ref/normal.eml3.cid
@@ -0,0 +1,345 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Type: multipart/related; boundary="alian-mime-lite-html"
+
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+	<img  src=3D"cid:57374732f646f63732f696d672f736f6d6d616972652e676966 at MIME-=
+Lite-HTML-1.23" alt=3D"Alian" border=3D"0">
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"javascript:alert('http://validator.alianet');">Validator=
+ HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <57374732f646f63732f696d672f736f6d6d616972652e676966 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+R0lGODlhMgAyANX/AP///9b//87//8b//8bv773n57X//7Xv77XW1q3//63OzqXGxpzv75zGxpy1
+tZT3/5StrYylpYT3/3v3/3uUlHP3/3OMjGulpWuEhGNzc1qMjFpra1JjY8DAwEpjY0pSUjlKSjk5
+OTFCQik5OSEpKRghIRgYGADn9wDe7wDO3gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAB0ALAAAAAAyADIAQAb/wI5w
+SCwaj8ikcslsOlUAg3RKraqcz4B2y+16v2BwInXtqMLotDowGJfPWozqE8A4Ao5RQEVYkOoYe31/
+GIF0GYEiC4IBGRANHhpkQiqVlpeYmZqbnJZYn6ChoqBnKaanqKmqKKytrKqwp29rtLVsbpRaDhwY
+ELZqKgVfbZNmAcIFi1p9BL/HBQTCXwQNBbij2Nna29zZnZfdRlAn5OXm5+Zl23DO7V3X7O7tAsSz
+8vL1uffz+cYLJc0Q7KPV78wCgXUscLCg5Y9BEYD2BFgAsRCCiokWwQFBIcCBC8XiDazVL5zJkyhT
+qlzJsqXLl0OgAJhJsyZNdSehTJDwoILPwJ8+H0yoMKEoznUAXCldujRTiG+ZciWYSrWq1atYqW7J
+OjWkLQMjtcALu2aAWbNjydKil1atGrZe3b4tKLds27ph6BYwoQWEWmld4NojUULBMkQhEPxTUIIC
+BhIKFjd+bHhDBhEKCoRY8C8DCQIcMoBg4LVZAAQlIijScsZgiIiuIzqIsCHQZokBIArOteCDAwcg
+opFwYEeBCgUYTCgAAcLB8eTLQRinAOIDagwLjp82QWJ0XLxgdhsDH74kTCVBAAA7
+
+--alian-mime-lite-html--
+
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/normal.eml3.extern b/t/ref/normal.eml3.extern
new file mode 100644
index 0000000..8e6f194
--- /dev/null
+++ b/t/ref/normal.eml3.extern
@@ -0,0 +1,315 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"javascript:alert('http://validator.alianet');">Validator=
+ HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/normal.eml3.location b/t/ref/normal.eml3.location
new file mode 100644
index 0000000..5a68f2f
--- /dev/null
+++ b/t/ref/normal.eml3.location
@@ -0,0 +1,345 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Type: multipart/related; boundary="alian-mime-lite-html"
+
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"javascript:alert('http://validator.alianet');">Validator=
+ HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+R0lGODlhMgAyANX/AP///9b//87//8b//8bv773n57X//7Xv77XW1q3//63OzqXGxpzv75zGxpy1
+tZT3/5StrYylpYT3/3v3/3uUlHP3/3OMjGulpWuEhGNzc1qMjFpra1JjY8DAwEpjY0pSUjlKSjk5
+OTFCQik5OSEpKRghIRgYGADn9wDe7wDO3gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAB0ALAAAAAAyADIAQAb/wI5w
+SCwaj8ikcslsOlUAg3RKraqcz4B2y+16v2BwInXtqMLotDowGJfPWozqE8A4Ao5RQEVYkOoYe31/
+GIF0GYEiC4IBGRANHhpkQiqVlpeYmZqbnJZYn6ChoqBnKaanqKmqKKytrKqwp29rtLVsbpRaDhwY
+ELZqKgVfbZNmAcIFi1p9BL/HBQTCXwQNBbij2Nna29zZnZfdRlAn5OXm5+Zl23DO7V3X7O7tAsSz
+8vL1uffz+cYLJc0Q7KPV78wCgXUscLCg5Y9BEYD2BFgAsRCCiokWwQFBIcCBC8XiDazVL5zJkyhT
+qlzJsqXLl0OgAJhJsyZNdSehTJDwoILPwJ8+H0yoMKEoznUAXCldujRTiG+ZciWYSrWq1atYqW7J
+OjWkLQMjtcALu2aAWbNjydKil1atGrZe3b4tKLds27ph6BYwoQWEWmld4NojUULBMkQhEPxTUIIC
+BhIKFjd+bHhDBhEKCoRY8C8DCQIcMoBg4LVZAAQlIijScsZgiIiuIzqIsCHQZokBIArOteCDAwcg
+opFwYEeBCgUYTCgAAcLB8eTLQRinAOIDagwLjp82QWJ0XLxgdhsDH74kTCVBAAA7
+
+--alian-mime-lite-html--
+
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_a_href.eml.cid b/t/ref/space_in_a_href.eml.cid
new file mode 100644
index 0000000..06536f2
--- /dev/null
+++ b/t/ref/space_in_a_href.eml.cid
@@ -0,0 +1,96 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href =3D  "http://alianwebserver.alianet">Alianwebserver</a>  </=
+li>
+  <li>  <a href =3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D "http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D "http://docs.alianet">Documentation</a></li>
+  <li>  <a href =3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_a_href.eml.extern b/t/ref/space_in_a_href.eml.extern
new file mode 100644
index 0000000..06536f2
--- /dev/null
+++ b/t/ref/space_in_a_href.eml.extern
@@ -0,0 +1,96 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href =3D  "http://alianwebserver.alianet">Alianwebserver</a>  </=
+li>
+  <li>  <a href =3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D "http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D "http://docs.alianet">Documentation</a></li>
+  <li>  <a href =3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_a_href.eml.location b/t/ref/space_in_a_href.eml.location
new file mode 100644
index 0000000..06536f2
--- /dev/null
+++ b/t/ref/space_in_a_href.eml.location
@@ -0,0 +1,96 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href =3D  "http://alianwebserver.alianet">Alianwebserver</a>  </=
+li>
+  <li>  <a href =3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D "http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D "http://docs.alianet">Documentation</a></li>
+  <li>  <a href =3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_a_href.eml2.cid b/t/ref/space_in_a_href.eml2.cid
new file mode 100644
index 0000000..8a1fa05
--- /dev/null
+++ b/t/ref/space_in_a_href.eml2.cid
@@ -0,0 +1,78 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href =3D  "http://alianwebserver.alianet">Alianwebserver</a>  </=
+li>
+  <li>  <a href =3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D "http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D "http://docs.alianet">Documentation</a></li>
+  <li>  <a href =3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
diff --git a/t/ref/space_in_a_href.eml2.extern b/t/ref/space_in_a_href.eml2.extern
new file mode 100644
index 0000000..8a1fa05
--- /dev/null
+++ b/t/ref/space_in_a_href.eml2.extern
@@ -0,0 +1,78 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href =3D  "http://alianwebserver.alianet">Alianwebserver</a>  </=
+li>
+  <li>  <a href =3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D "http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D "http://docs.alianet">Documentation</a></li>
+  <li>  <a href =3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
diff --git a/t/ref/space_in_a_href.eml2.location b/t/ref/space_in_a_href.eml2.location
new file mode 100644
index 0000000..8a1fa05
--- /dev/null
+++ b/t/ref/space_in_a_href.eml2.location
@@ -0,0 +1,78 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href =3D  "http://alianwebserver.alianet">Alianwebserver</a>  </=
+li>
+  <li>  <a href =3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D "http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D "http://docs.alianet">Documentation</a></li>
+  <li>  <a href =3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
diff --git a/t/ref/space_in_a_href.eml3.cid b/t/ref/space_in_a_href.eml3.cid
new file mode 100644
index 0000000..f2a7354
--- /dev/null
+++ b/t/ref/space_in_a_href.eml3.cid
@@ -0,0 +1,197 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href =3D  "http://alianwebserver.alianet">Alianwebserver</a>  </=
+li>
+  <li>  <a href =3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D "http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D "http://docs.alianet">Documentation</a></li>
+  <li>  <a href =3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_a_href.eml3.extern b/t/ref/space_in_a_href.eml3.extern
new file mode 100644
index 0000000..f2a7354
--- /dev/null
+++ b/t/ref/space_in_a_href.eml3.extern
@@ -0,0 +1,197 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href =3D  "http://alianwebserver.alianet">Alianwebserver</a>  </=
+li>
+  <li>  <a href =3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D "http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D "http://docs.alianet">Documentation</a></li>
+  <li>  <a href =3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_a_href.eml3.location b/t/ref/space_in_a_href.eml3.location
new file mode 100644
index 0000000..f2a7354
--- /dev/null
+++ b/t/ref/space_in_a_href.eml3.location
@@ -0,0 +1,197 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href =3D  "http://alianwebserver.alianet">Alianwebserver</a>  </=
+li>
+  <li>  <a href =3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D "http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D "http://docs.alianet">Documentation</a></li>
+  <li>  <a href =3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_ccs_href.eml.cid b/t/ref/space_in_ccs_href.eml.cid
new file mode 100644
index 0000000..9362d46
--- /dev/null
+++ b/t/ref/space_in_ccs_href.eml.cid
@@ -0,0 +1,95 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_ccs_href.eml.extern b/t/ref/space_in_ccs_href.eml.extern
new file mode 100644
index 0000000..9362d46
--- /dev/null
+++ b/t/ref/space_in_ccs_href.eml.extern
@@ -0,0 +1,95 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_ccs_href.eml.location b/t/ref/space_in_ccs_href.eml.location
new file mode 100644
index 0000000..9362d46
--- /dev/null
+++ b/t/ref/space_in_ccs_href.eml.location
@@ -0,0 +1,95 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_ccs_href.eml2.cid b/t/ref/space_in_ccs_href.eml2.cid
new file mode 100644
index 0000000..6bc0b64
--- /dev/null
+++ b/t/ref/space_in_ccs_href.eml2.cid
@@ -0,0 +1,77 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
diff --git a/t/ref/space_in_ccs_href.eml2.extern b/t/ref/space_in_ccs_href.eml2.extern
new file mode 100644
index 0000000..6bc0b64
--- /dev/null
+++ b/t/ref/space_in_ccs_href.eml2.extern
@@ -0,0 +1,77 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
diff --git a/t/ref/space_in_ccs_href.eml2.location b/t/ref/space_in_ccs_href.eml2.location
new file mode 100644
index 0000000..6bc0b64
--- /dev/null
+++ b/t/ref/space_in_ccs_href.eml2.location
@@ -0,0 +1,77 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
diff --git a/t/ref/space_in_ccs_href.eml3.cid b/t/ref/space_in_ccs_href.eml3.cid
new file mode 100644
index 0000000..11defa2
--- /dev/null
+++ b/t/ref/space_in_ccs_href.eml3.cid
@@ -0,0 +1,196 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_ccs_href.eml3.extern b/t/ref/space_in_ccs_href.eml3.extern
new file mode 100644
index 0000000..11defa2
--- /dev/null
+++ b/t/ref/space_in_ccs_href.eml3.extern
@@ -0,0 +1,196 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_ccs_href.eml3.location b/t/ref/space_in_ccs_href.eml3.location
new file mode 100644
index 0000000..11defa2
--- /dev/null
+++ b/t/ref/space_in_ccs_href.eml3.location
@@ -0,0 +1,196 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_img.eml.cid b/t/ref/space_in_img.eml.cid
new file mode 100644
index 0000000..2872671
--- /dev/null
+++ b/t/ref/space_in_img.eml.cid
@@ -0,0 +1,247 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Type: multipart/related; boundary="alian-mime-lite-html"
+
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+	<img  src=3D"cid:57374732f646f63732f696d672f736f6d6d616972652e676966 at MIME-=
+Lite-HTML-1.23" alt=3D"Alian" border=3D"0">
+	<img  src=3D"cid:57374732f646f63732f696d672f736f6d6d616972652e676966 at MIME-=
+Lite-HTML-1.23" alt=3D"Alian" border=3D"0">
+	<img  src=3D"cid:57374732f646f63732f696d672f736f6d6d616972652e676966 at MIME-=
+Lite-HTML-1.23" alt=3D"Alian" border=3D"0">
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <57374732f646f63732f696d672f736f6d6d616972652e676966 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+R0lGODlhMgAyANX/AP///9b//87//8b//8bv773n57X//7Xv77XW1q3//63OzqXGxpzv75zGxpy1
+tZT3/5StrYylpYT3/3v3/3uUlHP3/3OMjGulpWuEhGNzc1qMjFpra1JjY8DAwEpjY0pSUjlKSjk5
+OTFCQik5OSEpKRghIRgYGADn9wDe7wDO3gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAB0ALAAAAAAyADIAQAb/wI5w
+SCwaj8ikcslsOlUAg3RKraqcz4B2y+16v2BwInXtqMLotDowGJfPWozqE8A4Ao5RQEVYkOoYe31/
+GIF0GYEiC4IBGRANHhpkQiqVlpeYmZqbnJZYn6ChoqBnKaanqKmqKKytrKqwp29rtLVsbpRaDhwY
+ELZqKgVfbZNmAcIFi1p9BL/HBQTCXwQNBbij2Nna29zZnZfdRlAn5OXm5+Zl23DO7V3X7O7tAsSz
+8vL1uffz+cYLJc0Q7KPV78wCgXUscLCg5Y9BEYD2BFgAsRCCiokWwQFBIcCBC8XiDazVL5zJkyhT
+qlzJsqXLl0OgAJhJsyZNdSehTJDwoILPwJ8+H0yoMKEoznUAXCldujRTiG+ZciWYSrWq1atYqW7J
+OjWkLQMjtcALu2aAWbNjydKil1atGrZe3b4tKLds27ph6BYwoQWEWmld4NojUULBMkQhEPxTUIIC
+BhIKFjd+bHhDBhEKCoRY8C8DCQIcMoBg4LVZAAQlIijScsZgiIiuIzqIsCHQZokBIArOteCDAwcg
+opFwYEeBCgUYTCgAAcLB8eTLQRinAOIDagwLjp82QWJ0XLxgdhsDH74kTCVBAAA7
+
+--alian-mime-lite-html--
+
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_img.eml.extern b/t/ref/space_in_img.eml.extern
new file mode 100644
index 0000000..b2b72f4
--- /dev/null
+++ b/t/ref/space_in_img.eml.extern
@@ -0,0 +1,217 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_img.eml.location b/t/ref/space_in_img.eml.location
new file mode 100644
index 0000000..d3a18d5
--- /dev/null
+++ b/t/ref/space_in_img.eml.location
@@ -0,0 +1,247 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Type: multipart/related; boundary="alian-mime-lite-html"
+
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+R0lGODlhMgAyANX/AP///9b//87//8b//8bv773n57X//7Xv77XW1q3//63OzqXGxpzv75zGxpy1
+tZT3/5StrYylpYT3/3v3/3uUlHP3/3OMjGulpWuEhGNzc1qMjFpra1JjY8DAwEpjY0pSUjlKSjk5
+OTFCQik5OSEpKRghIRgYGADn9wDe7wDO3gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAB0ALAAAAAAyADIAQAb/wI5w
+SCwaj8ikcslsOlUAg3RKraqcz4B2y+16v2BwInXtqMLotDowGJfPWozqE8A4Ao5RQEVYkOoYe31/
+GIF0GYEiC4IBGRANHhpkQiqVlpeYmZqbnJZYn6ChoqBnKaanqKmqKKytrKqwp29rtLVsbpRaDhwY
+ELZqKgVfbZNmAcIFi1p9BL/HBQTCXwQNBbij2Nna29zZnZfdRlAn5OXm5+Zl23DO7V3X7O7tAsSz
+8vL1uffz+cYLJc0Q7KPV78wCgXUscLCg5Y9BEYD2BFgAsRCCiokWwQFBIcCBC8XiDazVL5zJkyhT
+qlzJsqXLl0OgAJhJsyZNdSehTJDwoILPwJ8+H0yoMKEoznUAXCldujRTiG+ZciWYSrWq1atYqW7J
+OjWkLQMjtcALu2aAWbNjydKil1atGrZe3b4tKLds27ph6BYwoQWEWmld4NojUULBMkQhEPxTUIIC
+BhIKFjd+bHhDBhEKCoRY8C8DCQIcMoBg4LVZAAQlIijScsZgiIiuIzqIsCHQZokBIArOteCDAwcg
+opFwYEeBCgUYTCgAAcLB8eTLQRinAOIDagwLjp82QWJ0XLxgdhsDH74kTCVBAAA7
+
+--alian-mime-lite-html--
+
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_img.eml2.cid b/t/ref/space_in_img.eml2.cid
new file mode 100644
index 0000000..d4297c6
--- /dev/null
+++ b/t/ref/space_in_img.eml2.cid
@@ -0,0 +1,230 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/related; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+	<img  src=3D"cid:57374732f646f63732f696d672f736f6d6d616972652e676966 at MIME-=
+Lite-HTML-1.23" alt=3D"Alian" border=3D"0">
+	<img  src=3D"cid:57374732f646f63732f696d672f736f6d6d616972652e676966 at MIME-=
+Lite-HTML-1.23" alt=3D"Alian" border=3D"0">
+	<img  src=3D"cid:57374732f646f63732f696d672f736f6d6d616972652e676966 at MIME-=
+Lite-HTML-1.23" alt=3D"Alian" border=3D"0">
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <57374732f646f63732f696d672f736f6d6d616972652e676966 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+R0lGODlhMgAyANX/AP///9b//87//8b//8bv773n57X//7Xv77XW1q3//63OzqXGxpzv75zGxpy1
+tZT3/5StrYylpYT3/3v3/3uUlHP3/3OMjGulpWuEhGNzc1qMjFpra1JjY8DAwEpjY0pSUjlKSjk5
+OTFCQik5OSEpKRghIRgYGADn9wDe7wDO3gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAB0ALAAAAAAyADIAQAb/wI5w
+SCwaj8ikcslsOlUAg3RKraqcz4B2y+16v2BwInXtqMLotDowGJfPWozqE8A4Ao5RQEVYkOoYe31/
+GIF0GYEiC4IBGRANHhpkQiqVlpeYmZqbnJZYn6ChoqBnKaanqKmqKKytrKqwp29rtLVsbpRaDhwY
+ELZqKgVfbZNmAcIFi1p9BL/HBQTCXwQNBbij2Nna29zZnZfdRlAn5OXm5+Zl23DO7V3X7O7tAsSz
+8vL1uffz+cYLJc0Q7KPV78wCgXUscLCg5Y9BEYD2BFgAsRCCiokWwQFBIcCBC8XiDazVL5zJkyhT
+qlzJsqXLl0OgAJhJsyZNdSehTJDwoILPwJ8+H0yoMKEoznUAXCldujRTiG+ZciWYSrWq1atYqW7J
+OjWkLQMjtcALu2aAWbNjydKil1atGrZe3b4tKLds27ph6BYwoQWEWmld4NojUULBMkQhEPxTUIIC
+BhIKFjd+bHhDBhEKCoRY8C8DCQIcMoBg4LVZAAQlIijScsZgiIiuIzqIsCHQZokBIArOteCDAwcg
+opFwYEeBCgUYTCgAAcLB8eTLQRinAOIDagwLjp82QWJ0XLxgdhsDH74kTCVBAAA7
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_img.eml2.extern b/t/ref/space_in_img.eml2.extern
new file mode 100644
index 0000000..5a8a4db
--- /dev/null
+++ b/t/ref/space_in_img.eml2.extern
@@ -0,0 +1,199 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
diff --git a/t/ref/space_in_img.eml2.location b/t/ref/space_in_img.eml2.location
new file mode 100644
index 0000000..89bf5da
--- /dev/null
+++ b/t/ref/space_in_img.eml2.location
@@ -0,0 +1,230 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/related; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+R0lGODlhMgAyANX/AP///9b//87//8b//8bv773n57X//7Xv77XW1q3//63OzqXGxpzv75zGxpy1
+tZT3/5StrYylpYT3/3v3/3uUlHP3/3OMjGulpWuEhGNzc1qMjFpra1JjY8DAwEpjY0pSUjlKSjk5
+OTFCQik5OSEpKRghIRgYGADn9wDe7wDO3gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAB0ALAAAAAAyADIAQAb/wI5w
+SCwaj8ikcslsOlUAg3RKraqcz4B2y+16v2BwInXtqMLotDowGJfPWozqE8A4Ao5RQEVYkOoYe31/
+GIF0GYEiC4IBGRANHhpkQiqVlpeYmZqbnJZYn6ChoqBnKaanqKmqKKytrKqwp29rtLVsbpRaDhwY
+ELZqKgVfbZNmAcIFi1p9BL/HBQTCXwQNBbij2Nna29zZnZfdRlAn5OXm5+Zl23DO7V3X7O7tAsSz
+8vL1uffz+cYLJc0Q7KPV78wCgXUscLCg5Y9BEYD2BFgAsRCCiokWwQFBIcCBC8XiDazVL5zJkyhT
+qlzJsqXLl0OgAJhJsyZNdSehTJDwoILPwJ8+H0yoMKEoznUAXCldujRTiG+ZciWYSrWq1atYqW7J
+OjWkLQMjtcALu2aAWbNjydKil1atGrZe3b4tKLds27ph6BYwoQWEWmld4NojUULBMkQhEPxTUIIC
+BhIKFjd+bHhDBhEKCoRY8C8DCQIcMoBg4LVZAAQlIijScsZgiIiuIzqIsCHQZokBIArOteCDAwcg
+opFwYEeBCgUYTCgAAcLB8eTLQRinAOIDagwLjp82QWJ0XLxgdhsDH74kTCVBAAA7
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_img.eml3.cid b/t/ref/space_in_img.eml3.cid
new file mode 100644
index 0000000..e716816
--- /dev/null
+++ b/t/ref/space_in_img.eml3.cid
@@ -0,0 +1,348 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Type: multipart/related; boundary="alian-mime-lite-html"
+
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+	<img  src=3D"cid:57374732f646f63732f696d672f736f6d6d616972652e676966 at MIME-=
+Lite-HTML-1.23" alt=3D"Alian" border=3D"0">
+	<img  src=3D"cid:57374732f646f63732f696d672f736f6d6d616972652e676966 at MIME-=
+Lite-HTML-1.23" alt=3D"Alian" border=3D"0">
+	<img  src=3D"cid:57374732f646f63732f696d672f736f6d6d616972652e676966 at MIME-=
+Lite-HTML-1.23" alt=3D"Alian" border=3D"0">
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Id: <57374732f646f63732f696d672f736f6d6d616972652e676966 at MIME-Lite-HTML-1.23>
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+R0lGODlhMgAyANX/AP///9b//87//8b//8bv773n57X//7Xv77XW1q3//63OzqXGxpzv75zGxpy1
+tZT3/5StrYylpYT3/3v3/3uUlHP3/3OMjGulpWuEhGNzc1qMjFpra1JjY8DAwEpjY0pSUjlKSjk5
+OTFCQik5OSEpKRghIRgYGADn9wDe7wDO3gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAB0ALAAAAAAyADIAQAb/wI5w
+SCwaj8ikcslsOlUAg3RKraqcz4B2y+16v2BwInXtqMLotDowGJfPWozqE8A4Ao5RQEVYkOoYe31/
+GIF0GYEiC4IBGRANHhpkQiqVlpeYmZqbnJZYn6ChoqBnKaanqKmqKKytrKqwp29rtLVsbpRaDhwY
+ELZqKgVfbZNmAcIFi1p9BL/HBQTCXwQNBbij2Nna29zZnZfdRlAn5OXm5+Zl23DO7V3X7O7tAsSz
+8vL1uffz+cYLJc0Q7KPV78wCgXUscLCg5Y9BEYD2BFgAsRCCiokWwQFBIcCBC8XiDazVL5zJkyhT
+qlzJsqXLl0OgAJhJsyZNdSehTJDwoILPwJ8+H0yoMKEoznUAXCldujRTiG+ZciWYSrWq1atYqW7J
+OjWkLQMjtcALu2aAWbNjydKil1atGrZe3b4tKLds27ph6BYwoQWEWmld4NojUULBMkQhEPxTUIIC
+BhIKFjd+bHhDBhEKCoRY8C8DCQIcMoBg4LVZAAQlIijScsZgiIiuIzqIsCHQZokBIArOteCDAwcg
+opFwYEeBCgUYTCgAAcLB8eTLQRinAOIDagwLjp82QWJ0XLxgdhsDH74kTCVBAAA7
+
+--alian-mime-lite-html--
+
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_img.eml3.extern b/t/ref/space_in_img.eml3.extern
new file mode 100644
index 0000000..ac45005
--- /dev/null
+++ b/t/ref/space_in_img.eml3.extern
@@ -0,0 +1,318 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_img.eml3.location b/t/ref/space_in_img.eml3.location
new file mode 100644
index 0000000..db25887
--- /dev/null
+++ b/t/ref/space_in_img.eml3.location
@@ -0,0 +1,348 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Type: multipart/related; boundary="alian-mime-lite-html"
+
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+	<img  src=3D"file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif" a=
+lt=3D"Alian" border=3D"0">
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Location: file:///var/tmp/mime-lite-html-tests/docs/img/sommaire.gif
+Content-Transfer-Encoding: base64
+Content-Type: image/gif
+
+
+R0lGODlhMgAyANX/AP///9b//87//8b//8bv773n57X//7Xv77XW1q3//63OzqXGxpzv75zGxpy1
+tZT3/5StrYylpYT3/3v3/3uUlHP3/3OMjGulpWuEhGNzc1qMjFpra1JjY8DAwEpjY0pSUjlKSjk5
+OTFCQik5OSEpKRghIRgYGADn9wDe7wDO3gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAB0ALAAAAAAyADIAQAb/wI5w
+SCwaj8ikcslsOlUAg3RKraqcz4B2y+16v2BwInXtqMLotDowGJfPWozqE8A4Ao5RQEVYkOoYe31/
+GIF0GYEiC4IBGRANHhpkQiqVlpeYmZqbnJZYn6ChoqBnKaanqKmqKKytrKqwp29rtLVsbpRaDhwY
+ELZqKgVfbZNmAcIFi1p9BL/HBQTCXwQNBbij2Nna29zZnZfdRlAn5OXm5+Zl23DO7V3X7O7tAsSz
+8vL1uffz+cYLJc0Q7KPV78wCgXUscLCg5Y9BEYD2BFgAsRCCiokWwQFBIcCBC8XiDazVL5zJkyhT
+qlzJsqXLl0OgAJhJsyZNdSehTJDwoILPwJ8+H0yoMKEoznUAXCldujRTiG+ZciWYSrWq1atYqW7J
+OjWkLQMjtcALu2aAWbNjydKil1atGrZe3b4tKLds27ph6BYwoQWEWmld4NojUULBMkQhEPxTUIIC
+BhIKFjd+bHhDBhEKCoRY8C8DCQIcMoBg4LVZAAQlIijScsZgiIiuIzqIsCHQZokBIArOteCDAwcg
+opFwYEeBCgUYTCgAAcLB8eTLQRinAOIDagwLjp82QWJ0XLxgdhsDH74kTCVBAAA7
+
+--alian-mime-lite-html--
+
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_javascript.eml.cid b/t/ref/space_in_javascript.eml.cid
new file mode 100644
index 0000000..063d4b1
--- /dev/null
+++ b/t/ref/space_in_javascript.eml.cid
@@ -0,0 +1,212 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_javascript.eml.extern b/t/ref/space_in_javascript.eml.extern
new file mode 100644
index 0000000..063d4b1
--- /dev/null
+++ b/t/ref/space_in_javascript.eml.extern
@@ -0,0 +1,212 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_javascript.eml.location b/t/ref/space_in_javascript.eml.location
new file mode 100644
index 0000000..063d4b1
--- /dev/null
+++ b/t/ref/space_in_javascript.eml.location
@@ -0,0 +1,212 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_javascript.eml2.cid b/t/ref/space_in_javascript.eml2.cid
new file mode 100644
index 0000000..2b3a583
--- /dev/null
+++ b/t/ref/space_in_javascript.eml2.cid
@@ -0,0 +1,194 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
diff --git a/t/ref/space_in_javascript.eml2.extern b/t/ref/space_in_javascript.eml2.extern
new file mode 100644
index 0000000..2b3a583
--- /dev/null
+++ b/t/ref/space_in_javascript.eml2.extern
@@ -0,0 +1,194 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
diff --git a/t/ref/space_in_javascript.eml2.location b/t/ref/space_in_javascript.eml2.location
new file mode 100644
index 0000000..2b3a583
--- /dev/null
+++ b/t/ref/space_in_javascript.eml2.location
@@ -0,0 +1,194 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
diff --git a/t/ref/space_in_javascript.eml3.cid b/t/ref/space_in_javascript.eml3.cid
new file mode 100644
index 0000000..482d5bf
--- /dev/null
+++ b/t/ref/space_in_javascript.eml3.cid
@@ -0,0 +1,313 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_javascript.eml3.extern b/t/ref/space_in_javascript.eml3.extern
new file mode 100644
index 0000000..482d5bf
--- /dev/null
+++ b/t/ref/space_in_javascript.eml3.extern
@@ -0,0 +1,313 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_javascript.eml3.location b/t/ref/space_in_javascript.eml3.location
new file mode 100644
index 0000000..482d5bf
--- /dev/null
+++ b/t/ref/space_in_javascript.eml3.location
@@ -0,0 +1,313 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_javascript2.eml.cid b/t/ref/space_in_javascript2.eml.cid
new file mode 100644
index 0000000..063d4b1
--- /dev/null
+++ b/t/ref/space_in_javascript2.eml.cid
@@ -0,0 +1,212 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_javascript2.eml.extern b/t/ref/space_in_javascript2.eml.extern
new file mode 100644
index 0000000..063d4b1
--- /dev/null
+++ b/t/ref/space_in_javascript2.eml.extern
@@ -0,0 +1,212 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_javascript2.eml.location b/t/ref/space_in_javascript2.eml.location
new file mode 100644
index 0000000..063d4b1
--- /dev/null
+++ b/t/ref/space_in_javascript2.eml.location
@@ -0,0 +1,212 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+A text message
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_javascript2.eml2.cid b/t/ref/space_in_javascript2.eml2.cid
new file mode 100644
index 0000000..2b3a583
--- /dev/null
+++ b/t/ref/space_in_javascript2.eml2.cid
@@ -0,0 +1,194 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
diff --git a/t/ref/space_in_javascript2.eml2.extern b/t/ref/space_in_javascript2.eml2.extern
new file mode 100644
index 0000000..2b3a583
--- /dev/null
+++ b/t/ref/space_in_javascript2.eml2.extern
@@ -0,0 +1,194 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
diff --git a/t/ref/space_in_javascript2.eml2.location b/t/ref/space_in_javascript2.eml2.location
new file mode 100644
index 0000000..2b3a583
--- /dev/null
+++ b/t/ref/space_in_javascript2.eml2.location
@@ -0,0 +1,194 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
diff --git a/t/ref/space_in_javascript2.eml3.cid b/t/ref/space_in_javascript2.eml3.cid
new file mode 100644
index 0000000..482d5bf
--- /dev/null
+++ b/t/ref/space_in_javascript2.eml3.cid
@@ -0,0 +1,313 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_javascript2.eml3.extern b/t/ref/space_in_javascript2.eml3.extern
new file mode 100644
index 0000000..482d5bf
--- /dev/null
+++ b/t/ref/space_in_javascript2.eml3.extern
@@ -0,0 +1,313 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+
diff --git a/t/ref/space_in_javascript2.eml3.location b/t/ref/space_in_javascript2.eml3.location
new file mode 100644
index 0000000..482d5bf
--- /dev/null
+++ b/t/ref/space_in_javascript2.eml3.location
@@ -0,0 +1,313 @@
+MIME-Version: 1.0
+Content-Transfer-Encoding: binary
+Content-Type: multipart/alternative; boundary="alian-mime-lite-html"
+
+Subject: Mail in HTML with images
+To: MIME-Lite at alianwebserver.com
+From: MIME-Lite at alianwebserver.com
+X-Mailer: MIME::Lite::HTML 1.23
+
+This is a multi-part message in MIME format.
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=iso-8859-1
+
+
+
+
+		Automated Testing of Perl5 Interpreter for NetWare.
+
+
+
+A set of Standard Unit Test Scripts to test all the functionalities of 
+Perl5 Interpreter are available along with the CPAN download. They are 
+all located under 't' folder. These include sub-folders under 't' such 
+as: 'base', 'cmd', 'comp', 'io', lib', 'op', 'pod', 'pragma' and 'run'. 
+Each of these sub-folders contain few test scripts ('.t' files) under 
+them.
+
+Executing these test scripts on NetWare can be automated as per the 
+following:
+
+1. Generate automated scripts like 'base.pl', 'cmd.pl', 'comp.pl', 'io.pl',
+'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' that execute all the
+test scripts ('.t' files) under the corresponding folder.
+
+For example, 'base.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\base' folder,
+             'comp.pl' to test all the scripts 
+              under 'sys:\perl\scripts\t\comp' folder and so on.
+
+2. Generate an automated script, 'nwauto.pl' that executes all the above 
+mentioned '.pl' automated scripts, thus in turn executing all the '.t' 
+scripts.
+
+The script, 'NWScripts.pl' available under the 'NetWare\t' folder of the 
+CPAN download, is written to generate these automated scripts when 
+executed on a NetWare server. It generates 'base.pl', 'cmd.pl', 'comp.pl',
+'io.pl', 'lib.pl', 'op.pl', 'pod.pl', 'pragma.pl', 'run.pl' and also 
+'nwauto.pl' by including all the corresponding '.t' scripts in them in 
+backtick operators.
+
+For example, all the scripts that are under 't\base' folder will be 
+entered in 'base.pl' and so on. 'nwauto.pl' includes all these '.pl' 
+scripts like 'base.pl', 'comp.pl' etc.
+
+
+Perform the following steps to execute the automated scripts:
+
+1. Map your NetWare server to "i:"
+
+2. After complete build (building both interpreter and all extensions)
+of Perl for NetWare, execute "nmake nwinstall" in the 'NetWare' folder
+of the CPAN download. This installs all the library files, perl modules,
+the '.pl' files under 'NetWare\t' folder and all the '.t' scripts
+under 't' folder, all in appropriate folders onto your server.
+
+3. Execute the command  "perl t\NWModify.pl"  on the console command 
+prompt of your server. This script replaces
+
+     "@INC = " with "unshift @INC, "  and
+     "push @INC, " with "unshift @INC, "
+
+from all the scripts under 'sys:\perl\scripts\t' folder.
+
+This is done to include the correct path for libraries into the scripts 
+when executed on NetWare. If this is not done, some of the scripts will 
+not get executed since they cannot locate the corresponding libraries.
+
+4. Execute the command  "perl t\NWScripts.pl"  on the console command 
+prompt to generate the automated scripts mentioned above 
+under the 'sys:\perl\scripts\t' folder.
+
+5. Execute the command  "perl t\nwauto.pl"  on the server console command 
+prompt. This runs all the standard test scripts. If you desire to 
+redirect or save the results into a file, say 'nwauto.txt', then the 
+console command to execute is:  "perl t\nwauto.pl > nwauto.txt".
+
+6. If you wish to execute only a certain set of scripts, then run the 
+corresponding '.pl' file. For example, if you wish to execute only the 
+'lib' scripts, then execute 'lib.pl' through the server console command, 
+"perl t\lib.pl'. To redirect the results into a file, the console command
+ is, "perl t\lib.pl > lib.txt".
+
+
+
+Known Issues:
+
+The following scripts are commented out in the corresponding autoscript:
+
+1. 'openpid.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+2. 'argv.t' in 'sys:\perl\scripts\t\io.pl' script
+   Reason:
+     This either hangs or abends the server when executing through auto 
+     scripts. When run individually, the script execution goes through 
+     fine.
+
+3. 'filehandle.t' in 'sys:\perl\scripts\t\lib.pl' script
+   Reason:
+     This hangs in the last test case where it uses FileHandle::Pipe 
+     whether run individually or through an auto script.
+
+
+--alian-mime-lite-html
+MIME-Version: 1.0
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html; charset=iso-8859-1
+
+
+<html>
+<head>
+<title></title>
+<style type=3D"text/css">
+<!--
+body {=0D
+  margin: 2em 1em 2em 70px;=0D
+  font-family: sans-serif;=0D
+  color: black;=0D
+  background: white;=0D
+  background-position: top left;=0D
+  background-attachment: fixed;=0D
+  background-repeat: no-repeat;=0D
+}=0D
+=0D
+th, td { /* ns 4 */=0D
+  font-family: sans-serif;=0D
+}=0D
+=0D
+h1, h2, h3, h4, h5, h6 { text-align: left }=0D
+h1, h2, h3 { color: #005A9C }=0D
+h1 { font: 150% sans-serif }=0D
+h2 { font: 130% sans-serif }=0D
+h3 { font: 110% sans-serif }=0D
+h4 { font: bold 100% sans-serif }=0D
+h5 { font: italic 100% sans-serif }=0D
+
+-->
+</style>
+
+<link REV=3D"made"  href=3D"mailto:alian at alianwebserver.com">
+<body>
+
+<!-- file:///var/tmp/mime-lite-html-tests/docs/acceuil.js -->
+<script   type=3D"text/javascript">
+<!--
+var edito =3D "24//06//2002";=0D
+edito +=3D"";=0D
+=0D
+// edito +=3D "Une nouvelle page d'acceuil pour 1001cartes, notre site de c=
+artes virtuelles... ";=0D
+//edito +=3D " La f=EAte d'HALLOWEEN est pass=E9e, mais les enfants restent=
+ dans l'ambiance encore toutes les vacances... ";=0D
+edito +=3D " L'=E9t=E9 est l=E0, il fait chaud, et c'est bient=F4t les vaca=
+nces ! N'oubliez pas d'envoyer une carte postale... ";=0D
+=0D
+function verifieUrl()=0D
+  {=0D
+  if (parent.document.location!=3Dthis.document.location)  =0D
+    {parent.document.location=3Dthis.document.location;}=0D
+  }=0D
+// Fonction de scroll dans la barre des status=0D
+function scrollit_r2l(seed)=0D
+{=0D
+  verifieUrl();=0D
+        var m1  =3Dedito;=0D
+        var msg=3Dm1;=0D
+        var out =3D " ";=0D
+        var c   =3D 1;=0D
+        if (seed > 100) =0D
+          {=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+              }=0D
+        else if (seed <=3D 100 && seed > 0) =0D
+                {=0D
+                for (c=3D0 ; c < seed ; c++) {out+=3D" ";}=0D
+                out+=3Dmsg;=0D
+                seed--;=0D
+                var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                    window.status=3Dout;=0D
+                timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+             }=0D
+       else if (seed <=3D 0) =0D
+    {=0D
+                if (-seed < msg.length) =0D
+      {=0D
+                        out+=3Dmsg.substring(-seed,msg.length);=0D
+                        seed--;=0D
+                        var cmd=3D"scrollit_r2l(" + seed + ")";=0D
+                        window.status=3Dout;=0D
+                        timerTwo=3Dwindow.setTimeout(cmd,50);=0D
+                  }=0D
+                else =0D
+          {=0D
+         window.status=3D" ";=0D
+                        timerTwo=3Dwindow.setTimeout("scrollit_r2l(100)",50=
+);=0D
+                  }=0D
+          }=0D
+  }=0D
+=0D
+function checkMoteur(theForm)=0D
+{=0D
+=0D
+  if (theForm.MOT_CLEF.value =3D=3D "")=0D
+  {=0D
+    alert("Vous devez donnez des mots-clefs pour effectuer votre recherche =
+.");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.MOT_CLEF.value.length < 2)=0D
+  {=0D
+    alert("Tapez au moins 2 caract=E8res pour que votre recherche soit pert=
+inente .");=0D
+    theForm.MOT_CLEF.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+=0D
+function checkMail(theForm)=0D
+{=0D
+=0D
+  if (theForm.mail.value =3D=3D "<Votre adresse Mail>")=0D
+  {=0D
+    alert("Vous devez donnez votre adresse Mail.");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length < 5)=0D
+  {=0D
+    alert("Tapez au moins 5 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+=0D
+  if (theForm.mail.value.length > 30)=0D
+  {=0D
+    alert("Tapez au plus 30 caractres dans le champ \"mail\".");=0D
+    theForm.mail.focus();=0D
+    return (false);=0D
+  }=0D
+  return (true);=0D
+}=0D
+function banner(msg,ctrlwidth)=0D
+  {=0D
+  document.write ('<APPLET CODE=3Dscroll WIDTH=3D400 HEIGHT=3D16>');=0D
+  document.write ('<PARAM NAME=3DTEXT VALUE=3D"$' + edito + '$">');=0D
+  document.write ('<PARAM NAME=3DSPEED VALUE=3Dfast></APPLET>');  =0D
+  }=0D
+
+-->
+</script>
+
+	<h1>Alianet Network</h1>
+
+<h2>Intranet</h2>
+<ol>
+  <li>  <a href=3D"http://alianwebserver.alianet">Alianwebserver</a>  </li>
+  <li>  <a href=3D"http://1001cartes.alianet">1001 Cartes</a></li>
+  <li>  <a href=3D"http://mp3.alianet">Mp3</a> </li>
+  <li>  <a href=3D"http://docs.alianet">Documentation</a></li>
+  <li>  <a href=3D"http://validator.alianet">Validator HTML</a></li>
+  <li>  <a href=3D"file:///ldap">Annuaire LDAP</a></li>
+  <li>  <a href=3D"file:///phpMyAdmin">Administration Mysql</a></li>
+  <li>  <a href=3D"http://saturne.alianet/mod-perl/circa/admin.cgi">Adminis=
+tration Circa</a></li>
+  <li>  <a href=3D"file:///mod-perl/cvsweb.cgi/">Developpement / cvsweb.cgi=
+</a></li>
+  <li>  <a href=3D"http://saturne.alianet/cgi-bin/parserSyslog.cgi">Syslog<=
+/a></li>
+</ol>
+
+<h2>Internet</h2>
+<ol>
+  <li>  <a href=3D"http://www.alianwebserver.com">Alianwebserver</a></li>
+  <li>  <a href=3D"http://www.1001cartes.com">1001 Cartes</a></li>
+  <li>  <a href=3D"http://www.comclick.com">Publicité Alianwebserver=
+</a></li>=20
+  <li>  <a href=3D"http://www.alianwebserver.com/stats/">Stats Alianwebserv=
+er</a></li>
+  <li>  <a href=3D"http://www.yahoo.fr">Yahoo</a></li>
+  <li>  <a href=3D"http://www.jeuxvideo.com">JeuxVideo.com</a></li>
+  <li>  <a href=3D"http://www.google.com">Google</a></li>
+  <li>  <a href=3D"http://www.lejour.com">Le jour</a></li>
+</ol>
+
+</ol>
+</body>
+</html>
+
+--alian-mime-lite-html--
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-sympa/libmime-lite-html-perl.git



More information about the Pkg-sympa-commits mailing list