[-]
[+]
|
Changed |
perl-MIME-tools.spec
|
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/ChangeLog
^
|
@@ -1,113 +1,11 @@
-5.426 2008-03-07 Dave O'Neill <dmo@roaringpenguin.com>
- * VERSION 5.426 RELEASED
-
- * (bugfix) require File::Temp 0.18 or newer, as we need seek()
- (RT#31032)
-
- * (bugfix) Don't hang forever in t/Smtpsend.t (RT#31082)
-
- * (bugfix) require Perl 5.8.0 or newer in Makefile.PL (RT#30927)
-
- * (bugfix) encode_mimewords() no longer removes spaces between two
- encoded words (RT#5462)
-
-5.425 2007-11-17 Dave O'Neill <dmo@roaringpenguin.com>
-
- * VERSION 5.425 RELEASED
-
- * (bugfix) A stub for MIME::Parser's tmp_recycling() method has been
- re-added to preserve compatibility. Since recycling of tempfiles
- never worked and has been removed, any code calling tmp_recycling()
- should stop attempting to use the feature.
-
-5.424 2007-11-07 David Skoll <dfs@roaringpenguin.com>
-
- * VERSION 5.424 RELEASED
-
- * (bugfix) [rt.cpan.org #29864] - lines in $entity->body() should be
- newline-terminated.
-
-5.423 2007-09-27 Dave O'Neill <dmo@roaringpenguin.com>
-
- * VERSION 5.423 RELEASED
-
- * (bugfix) Fix API regression - MIME::Entity::body() should return an
- arrayref. Fixes RT 29643.
-
-5.422 2007-09-25 Dave O'Neill <dmo@roaringpenguin.com>
-
- * VERSION 5.422 RELEASED
-
- * (bugfix) Require File::Temp 0.17 or newer for IO::Seekable support.
- This fixes test failures seen on Darwin.
-
- * (bugfix) Clear filer's purgeable() before calling init_parse(). Fixes RT 7858.
-
-5.421 2007-09-21 Dave O'Neill <dmo@roaringpenguin.com>
-
- * VERSION 5.421 RELEASED
-
- * (enhancement) Use File::Temp for tempfile generation. MIME::Parser
- now has a tmp_dir() method for changing the temporary directory on a
- per-parser basis.
-
-5.420_02 2007-08-29 Dave O'Neill <dmo@roaringpenguin.com>
-
- * VERSION 5.420_02 (developer release)
-
- * (bugfix) Correct 'use vars' and add a 'use strict' (fixes RT #22681)
-
- * (bugfix) Don't allow all-whitespace filenames in
- recommended_filename() (fixes RT #6115)
-
- * (bugfix) Require IO-stringy 2.110. Fixes RT tickets 11312, 11452,
- 12375, 12784, and 18791
-
- * (docs) Updated RFC references to refer to MIME RFCs 2045-2049 (RT #14119)
-
- * (cleanup) Warn if no decoder is found for a given encoding. (RT #22682)
-
- * (cleanup) IO::Wrap no longer used, IO::ScalarArray use minimized
-
-
-5.420_01 2007-06-18 Dave O'Neill <dmo@roaringpenguin.com>
-
- * VERSION 5.420_01 (developer release)
-
- * (bugfix) Fix warning generated by a header of "Content-Type: /".
- Previous versions would warn about undefined variables. We now
- set a blank type and subtype.
-
- * (cleanup) Partial removal of dependencies on IO::Scalar and
- IO::ScalarArray. We now use Perl's built-in I/O on scalars as much
- as possible. NOTE THAT THIS REQUIRES PERL 5.8!
-
- * (cleanup) FileHandle usage removed in favour of IO::File
-
- * (cleanup) Remove broken utility methods -- shellquote() because it
- didn't really make anything safe, and catfile(), because File::Spec
- is better.
-
- * (cleanup) Multiple test cleanups, including removal of
- ExtUtils/TBone.pm. Tests now use Test::More.
-
- * (cleanup) Remove support for recycling tempfiles ( tmp_recycling() and
- its usage in new_tmpfile() )
-
- * (cleanup) Remove nasty "eval join('',<::DATA>) unless caller()"
- testing code from various modules
-
- * (cleanup) Merge all changelog information from README and
- MIME/Tools.pm into ChangeLog
-
-5.420 2006-03-17 David F. Skoll <dfs@roaringpenguin.com>
-
+2006-03-17 David F. Skoll <dfs@roaringpenguin.com>
+
* VERSION 5.420 RELEASED
* Fix regression introduced in 5.419 -- quoted-printable
encoding would sometimes fail on "textual" MIME parts.
-5.419 2005-12-22 David F. Skoll <dfs@roaringpenguin.com>
+2005-12-22 David F. Skoll <dfs@roaringpenguin.com>
* VERSION 5.419 RELEASED
@@ -116,7 +14,7 @@
if you need the exact unmangled message source (for example,
for GPG-signing.) Patch submitted by Jörn Reder.
-5.418 2005-09-29 David F. Skoll <dfs@roaringpenguin.com>
+2005-09-29 David F. Skoll <dfs@roaringpenguin.com>
* VERSION 5.418 RELEASED
@@ -131,7 +29,7 @@
* MANIFEST: Remove some useless internal files from the manifest.
They were never meant to be part of the actual distribution.
-5.417 2005-01-20 David F. Skoll <dfs@roaringpenguin.com>
+2005-01-20 David F. Skoll <dfs@roaringpenguin.com>
* VERSION 5.417 RELEASED
@@ -143,7 +41,7 @@
parameters was buggy and caused decoding errors. This has been
fixed.
-5.416 2005-01-03 David F. Skoll <dfs@roaringpenguin.com>
+2005-01-03 David F. Skoll <dfs@roaringpenguin.com>
* VERSION 5.416 RELEASED
@@ -155,14 +53,14 @@
parameters. Apparently, not doing so can cause Perl to core dump
on certain badly-formed messages.
-5.415 2004-10-27 David F. Skoll <dfs@roaringpenguin.com>
+2004-10-27 David F. Skoll <dfs@roaringpenguin.com>
* VERSION 5.415 RELEASED
* Fixed parsing of parameter="" in headers, and fixed case where
multipart boundary is ""
-5.414 2004-10-06 David F. Skoll <dfs@roaringpenguin.com>
+2004-10-06 David F. Skoll <dfs@roaringpenguin.com>
* VERSION 5.414 RELEASED
@@ -172,14 +70,14 @@
* Check return values of I/O operations like open(), close(), etc.
and die if they fail. Problem reported by Mark Martinec.
-5.413 2004-09-15 David F. Skoll <dfs@roaringpenguin.com>
+2004-09-15 David F. Skoll <dfs@roaringpenguin.com>
* VERSION 5.413 RELEASED
* Fix some $VERSION = xxx assignments that were broken; make sure
VERSION shows up as 5.413 everywhere. Sorry about that!
-5.412 2004-09-09 David F. Skoll <dfs@roaringpenguin.com>
+2004-09-09 David F. Skoll <dfs@roaringpenguin.com>
* VERSION 5.412 RELEASED
@@ -233,718 +131,3 @@
of MIME parts we are willing to parse.
* DSKOLL took over maintainership of MIME::tools at version 5.411a.
-
-Version 5.411
- Regenerated docs. Bug in HTML docs, now all fixed.
-
-Version 5.410 (2000/11/23)
- Better detection of evil filenames. Now we check for filenames which
- are suspiciously long, and a new MIME::Filer::exorcise_filename()
- method is used to try and remove the evil. *Thanks to Jason Haar for
- the suggestion.*
-
-Version 5.409 (2000/11/12)
- Added functionality to MIME::WordDecoder, including support for
- plain US-ASCII.
-
- MIME::Tools::tmpopen() made more flexible. You can now override the
- tmpfile-opening behavior.
-
-Version 5.408 (2000/11/10)
- Added new Beta unmime() mechanism. See the MIME::WordDecoder manpage
- for full details. Also see the section on "Understand how
- international characters are represented".
-
-Version 5.405 (2000/11/05)
- Added a purge() that does what people want it to. Now, when a parse
- finishes and you want to delete everything that was created by it,
- you can invoke `purge()' on the parser's filer. All
- files/directories created during the last parse should vanish.
- *Thanks to everyone who complained about MIME::Entity::purge.*
-
-Version 5.404 (2000/11/04)
- Added new automatic MIME-decoding of attachment filenames with
- encoded (non-ASCII) characters. Hopefully this will do more good
- than harm. The use of MIME::Parser::decode_headers() and
- MIME::Head::decode() has been deprecated in favor of the new
- MIME::Words "unmime" mechanism. Please see the "unmime" entry in the
- MIME::Words manpage.
-
- Added tolerance for unquoted =?...?= in param values. This is in
- violation of the RFCs, but then, so are some MUAs. *Thanks to desti
- for bringing this to my attention.*
-
- Fixed supposedly-bad B-encoding. *Thanks to Otto Frost for bringing
- this to my attention.*
-
-Version 5.316 (2000/09/21)
- Increased tolerance in MIME::Parser. Now will ignore bogus POP3
- "+OK" line before header, as well as bogus mailbox "From " line
- (both with warnings). *Thanks to Antony OSullivan (ajos1) for
- suggesting this feature.*
-
- Fixed small epilogue-related bug in MIME::Entity::print_body(). Now
- it only outputs a final newline if the epilogue does not end in one
- already. Support for checking the preamble/epilogue in regression
- tests was also added. *Thanks to Lars Hecking for bringing this
- issue up.*
-
- Updated documentation. All module manual pages should now direct
- readers to the main MIME-tools manual page.
-
-Version 5.314 (2000/09/06)
- Fixed Makefile.PL to have less-restrictive requirement for
- File::Spec (0.6).
-
-Version 5.313 (2000/09/05)
- Fixed nasty bug with evil filenames. Certain evil filenames were
- getting replaced by internally-generated filenames which were just
- as evil... ouch! If your parser occasionally throws a fatal
- exception with a "write-open" error message, then you have this bug.
- *Thanks to Julian Field and Antony OSullivan (ajos1) for delivering
- the evidence!*
-
- Beware the doctor
- who cures seasonal head cold
- by killing patient
-
- Improved naming of extracted files. If a filename is regarded as
- evil, we guess that it might just be because of part information,
- and attempt to find and use the final path element.
-
- Simplified message logging and made it more consistent. For details,
- see the section on "Message-logging".
-
-Version 5.312 (2000/09/03)
- Fixed a Perl 5.7 select() incompatibility which caused "make test"
- to fail. *Thanks to Nick Ing-Simmons for the patch.*
-
-Version 5.311 (2000/08/16)
- Blind fix for Win32 uudecoding bug. A missing binmode seems to be
- the culprit here; let's see if this fixes it. *Thanks to ajos1 for
- finding the culprit!*
-
- The carriage return
- thumbs its nose at me, laughing:
- DOS I/O *still* sucks
-
-Version 5.310 (2000/08/15)
- Fixed a bug in the back-compat output_prefix() method of
- MIME::Parser. Basically, output prefixes were not being set through
- this mechanism. *Thanks to ajos1 for the alert.*
-
- shift @_, ### "shift at-underscore"
- or @_ will have
- bogus "self" object
-
- Added some backcompat methods, like parse_FH(). *Thanks (and
- apologies) to Alain Kotoujansky.*
-
- Added filenames-with-spaces support to MIME::Decoder::UU. *Thanks to
- Richard Pun for the suggestion.*
-
-Version 5.305 (2000/07/20)
- Added MIME::Entity::parts_DFS as convenient way to "get all parts".
- *Thanks to Xavier Armengou for suggesting this method.*
-
- Removed the Alpha notice. Still a few features to tweak, but those
- will be minor.
-
-Version 5.303 (2000/07/07)
- Fixed output bugs in new Filers. Scads of them: bad handling of
- filename collisions, bad implementation of output_under(), bad
- linking to results, POD errors, you name it. If this had gone to
- CPAN, I'd have issued a factory recall. `:-('
-
- Errors, like beetles,
- Multiply ferociously
- In the small hours
-
-Version 5.301 (2000/07/06)
- READ ME BEFORE UPGRADING PAST THIS POINT! New MIME::Parser::Filer
- class -- not fully backwards-compatible. In response to demand for
- more-comprehensive file-output strategies, I have decided that the
- best thing to do is to split all the file-output logic
- (output_path(), evil_filename(), etc.) into its own separate class,
- inheriting from the new MIME::Parser::Filer class. If you *override*
- any of the following in a MIME::Parser subclass, you will need to
- change your code accordingly:
-
- evil_filename
- output_dir
- output_filename
- output_path
- output_prefix
- output_under
-
- My sincere apologies for any inconvenience this will cause, but it's
- ultimately for the best, and is quite likely the last structural
- change to 5.x. *Thanks to Tyson Ackland for all the ideas.*
- Incidentally, the new code also fixes a bug where identically-named
- files in the same message could clobber each other.
-
- A message arrives:
- "Here are three files, all named 'Foo'"
- Only one survives. :-(
-
- Fixed bug in MIME::Words header decoding. Underscores were not being
- handled properly. *Thanks to Dominique Unruh and Doru Petrescu,* who
- independently submitted the same fix within 2 hours of each other,
- after this bug has lain dormant for months:
-
- Two users, same bug,
- same patch -- mere hours apart:
- Truly, life is odd.
-
- Removed escaping of underscore in regexps. Escaping the underscore
- (\_) in regexps was sloppy and wrong (escaped metacharacters may
- include anything in \w), and the newest Perls warn about it. *Thanks
- to David Dyck for bringing this to my attention.*
-
- What, then, is a word?
- Some letters, digits, and, yes:
- Underscores as well
-
- Added Force option to MIME::Entity's make_multipart. *Thanks to Bob
- Glickstein for suggesting this.*
-
- Numerous fixlets to example code. *Thanks to Doru Petrescu for
- these.*
-
- Added REQUIREMENTS section in docs. Long-overdue. *Thanks to Ingo
- Schmiegel for motivating this.*
-
-Version 5.211 (2000/06/24)
- Fixed auto-uudecode bug. Parser was failing with "part did not end
- with expected boundary" error when uuencoded entity was a
- *singlepart* message (ironically, uuencoded parts of multiparts
- worked fine). *Thanks to Michael Mohlere for testing uudecode and
- finding this.*
-
- The hurrying bee
- Flies far for nectar, missing
- The nearest flowers
-
- Say ten thousand times:
- Complex cases may succeed
- Where simple ones fail
-
- Parse errors now generate warnings. Parser errors now cause warn()s
- to be generated if they are not turned into fatal exceptions. This
- might be a little redundant, seeing as they are available in the
- "results", but parser-warnings already cause warn()s. I can always
- put in a "quiet" switch if people complain.
-
- Miscellaneous cleanup. Documentation of MIME::Parser improved
- slightly, and a redundant warning was removed.
-
-Version 5.210 (2000/06/20)
- Change in "evil" filename. Made MIME::Parser's evil_filename
- stricter by having it reject "path" characters: any of '/' '\' ':'
- '[' ']'.
-
- Just as with beauty
- The eye of the beholder
- Is where "evil" lives.
-
- Documentation fixes. Corrected a number of docs in MIME::Entity
- which were obsoleted in the transition from 4.x to 5.x. *Thanks to
- Michael Fischer for pointing these out.* For this one, a special 5-
- 5-5-5 Haiku of anagrams:
-
- Documentation
- in mutant code, O!
- Edit -- no, CUT! [moan]
- I meant to un-doc...
-
- IO::Lines usage bug fixed. MIME::Entity was missing a "use
- IO::Lines", which caused an exception when you tried to use the
- body() method of MIME::Entity. *Thanks to Hideyo Imazu and Michael
- Fischer for pointing this out.*
-
- Bareword looks fine, but
- Perl cries: "Whoa there... IO::Lines?
- Never heard of it."
-
-Version 5.209 (2000/06/10)
- Autodetection of uuencode. You can now tell the parser to hunt for
- uuencode inside what should be text parts. See extract_uuencode()
- for full details. Beware: this is largely untested at the moment.
- *Special thanks to Michael Mohlere at ADJE Webmail, who was the
- first -- and most-insistent -- user to request this feature.*
-
- Faster parsing. Sped up the MIME::Decoder::NBit decoder quite a bit
- by using a variant of the chunking trick I used for
- MIME::Decoder::Base64. I suspect that the same trick (reading a big
- chunk plus the next line to get a big block of lines) would work
- with MIME::Decoder::QuotedPrint, but I don't have the time or
- resources to check that right now (tested contributions would be
- welcome). NBit encoding is more-conveniently done line-by-line for
- now, because individual line lengths must be checked.
-
- Better use of core. MIME::Body::InCore is now used when you build()
- an entity with the Data parameter, instead of MIME::Body::Scalar.
-
- More documentation on toolkit configuration.
-
-Version 5.207 (2000/06/09)
- Fixed whine() bug in MIME::Parser where the "warning" method whine()
- was called as a static function instead of invoked as an instance
- method. *Thanks to Todd A. Bradfute for reporting this.*
-
- A simple warning
- Invokes method as function:
- "Warning" makes us die
-
-Version 5.206 (2000/06/08)
- Ahem. Cough cough:
-
- Way too many bugs
- Thus, a self-imposed penance:
- Write haiku for each
-
- Fixed bug in MIME::Parser: the reader was not handling the odd (but
- legal) case where a multipart boundary is followed by linear
- whitespace. *Thanks to Jon Agnew for reporting this with the RFC
- citation.*
-
- Legal message fails
- And 'round the globe, thousands cry:
- READ THE RFC
-
- Empty preambles are now handled properly by MIME::Entity when
- printing: there is now no space between the header-terminator and
- the initial boundary. *Thanks to "sen_ml" for suggesting this.*
-
- Nature hates vacuum
- But please refrain from tossing
- Newlines in the void
-
- Started using Benchmark for benchmarking.
-
-Version 5.205 (2000/06/06)
- Added terminating newline to all parser messages, and fixed small
- parser bug that was dropping parts when errors occurred in certain
- places.
-
-Version 5.203 (2000/06/05)
- Brand new parser based on new (private) MIME::Parser::Reader and
- (public) MIME::Parser::Results. Fast and yet simple and very
- tolerant of bad MIME when desired. Message reporting needs some
- muzzling.
-
- MIME::Parser now has ignore_errors() set true by default.
-
-Version 5.116 (2000/05/26)
- Removed Tmpfile.t test, which was causing a bogus failure in "make
- test". Now we require 5.004 for MIME::Parser anyway, so we don't
- need it. *Thanks to Jonathan Cohn for reporting this.*
-
-Version 5.115 (2000/05/24)
- Fixed Ref.t bug, and documented how to remove parts from a
- MIME::Entity.
-
-Version 5.114 (2000/05/23)
- Entity now uses MIME::Lite-style default suggested encoding.
-
- More regression test have been added, and the "Size" tests in Ref.t
- are skipped for text document (due to CRLF differences between
- platforms).
-
-Version 5.113 (2000/05/21)
- Major speed and structural improvements to the parser. *Major, MAJOR
- thanks to Noel Burton-Krahn, Jeremy Gilbert, and Doru Petrescu for
- all the patches, benchmarking, and Beta-testing!*
-
- Convenient new one-directory-per-message parsing mechanism. Now
- through `MIME::Parser' method `output_under()', you can tell the
- parser that you want it to create a unique directory for each
- message parsed, to hold the resulting parts.
-
- Elimination of $', $` and $&. Wow... I still can't believe I missed
- this. D'OH! *Thanks to Noel Burton-Krahn for all his patches.*
-
- Parser is more tolerant of weird EOL termination. Some mailagents
- are can terminate lines with "\r\r\n". We're okay with that now when
- we extract the header. *Thanks to Joao Fonseca for pointing this
- out.*
-
- Parser is tolerant of "From " lines in headers. *Thanks to Joachim
- Wieland, Anthony Hinsinger, Marius Stan, and numerous others.*
-
- Parser catches syntax errors in headers. *Thanks to Russell P.
- Sutherland for catching this.*
-
- Parser no longer warns when subtype is undefined. *Thanks to Eric-
- Olivier Le Bigot for his fix.*
-
- Better integration with Mail::Internet. For example, smtpsend()
- should work fine. *Thanks to Michael Fischer and others for the
- patch.*
-
- Miscellaneous cleanup. *Thanks to Marcus Brinkmann for additional
- helpful input.* *Thanks to Klaus Seidenfaden for good feedback on
- 5.x Alpha!*
-
-Version 4.123 (1999/05/12)
- Cleaned up some of the tests for non-Unix OS'es. Will require a few
- iterations, no doubt.
-
-Version 4.122 (1999/02/09)
- Resolved CORE::open warnings for 5.005. *Thanks to several folks for
- this bug report.*
-
-Version 4.121 (1998/06/03)
- Fixed MIME::Words infinite recursion. *Thanks to several folks for
- this bug report.*
-
-Version 4.117 (1998/05/01)
- Nicer MIME::Entity::build. No longer outputs warnings with undefined
- Filename, and now accepts Charset as well. *Thanks to Jason Tibbits
- III for the inspirational patch.*
-
- Documentation fixes. Hopefully we've seen the last of the pod2man
- warnings...
-
- Better test logging. Now uses ExtUtils::TBone.
-
-Version 4.116 (1998/02/14)
- Bug fix: MIME::Head and MIME::Entity were not downcasing the
- content-type as they claimed. This has now been fixed. *Thanks to
- Rodrigo de Almeida Siqueira for finding this.*
-
-Version 4.114 (1998/02/12)
- Gzip64-encoding has been improved, and turned off as a default,
- since it depends on having gzip installed. See MIME::Decoder::Gzip64
- if you want to activate it in your app. You can now set up the
- gzip/gunzip commands to use, as well. *Thanks to Paul J. Schinder
- for finding this bug.*
-
-Version 4.113 (1998/01/20)
- Bug fix: MIME::ParserBase was accidentally folding newlines in
- header fields. *Thanks to Jason L. Tibbitts III for spotting this.*
-
-Version 4.112 (1998/01/17)
- MIME::Entity::print_body now recurses when printing multipart
- entities, and prints "everything following the header." This is more
- likely what people expect to happen. PLEASE read the "two body
- problem" section of MIME::Entity's docs.
-
-Version 4.111 (1998/01/14)
- Clean build/test on Win95 using 5.004. Whew.
-
-Version 4.110 (1998/01/11)
- Added make_multipart() and make_singlepart() in MIME::Entity.
-
- Improved handling/saving of preamble/epilogue.
-
-Version 4.109 (1998/01/10)
- Overall Major version shift to 4.x accompanies numerous structural changes,
- and the deletion of some long-deprecated code. Many apologies to
- those who are inconvenienced by the upgrade.
-
- MIME::IO deprecated. You'll see IO::Scalar, IO::ScalarArray, and
- IO::Wrap to make this toolkit work.
-
- MIME::Entity deep code. You can now deep-copy MIME entities
- (except for on-disk data files).
-
- Encoding/decoding
- MIME::Latin1 deprecated, and 8-to-7 mapping removed. Really,
- MIME::Latin1 was one of my more dumber ideas. It's still there,
- but if you want to map 8-bit characters to Latin1 ASCII
- approximations when 7bit encoding, you'll have to request it
- explicitly. *But use quoted-printable for your 8-bit documents;
- that's what it's there for!*
-
- 7bit and 8bit "encoders" no longer encode. As per RFC-2045,
- these just do a pass-through of the data, but they'll warn you
- if you send bad data through.
-
- MIME::Entity suggests encoding. Now you can ask MIME::Entity's
- build() method to "suggest" a legal encoding based on the body
- and the content-type. No more guesswork! See the "mimesend"
- example.
-
- New module structure for MIME::Decoder classes. It should be
- easier for you to see what's happening.
-
- New MIME decoders! Support added for decoding `x-uuencode', and
- for decoding/encoding `x-gzip64'. You'll need "gzip" to make the
- latter work.
-
- Quoted-printable back on track... and then some. The 'quoted-
- printable' decoder now uses the newest MIME::QuotedPrint, and
- amends its output with guideline #8 from RFC2049 (From/.).
- *Thanks to Denis N. Antonioli for suggesting this.*
-
- Parsing Preamble and epilogue are now saved. These are saved in the parsed
- entities as simple string-arrays, and are output by print() if
- there. *Thanks to Jason L. Tibbitts for suggesting this.*
-
- The "multipart/digest" semantics are now preserved. Parts of
- digest messages have their mime_type() defaulted to
- "message/rfc822" instead of "text/plain", as per the RFC.
- *Thanks to Carsten Heyl for suggesting this.*
-
- Output Well-defined, more-complete print() output. When printing an entity,
- the output is now well-defined if the entity came from a
- MIME::Parser, even if using parse_nested_messages. See
- MIME::Entity for details.
-
- You can prevent recommended filenames from being output. This
- possible security hole has been plugged; when building MIME
- entities, you can specify a body path but suppress the filename
- in the header. *Thanks to Jason L. Tibbitts for suggesting
- this.*
-
- Bug fixes
- Win32 installations should work. The binmode() calls should work
- fine on Win32 now. *Thanks to numerous folks for their patches.*
-
- MIME::Head::add() now no longer downcases its argument. *Thanks
- to Brandon Browning & Jason L. Tibbitts for finding this bug.*
-
-Version 3.204
- Bug in MIME::Head::original_text fixed. Well, it took a while, but
- another bug surfaced from my transition from 1.x to 2.x. This method
- was, quite idiotically, sorting the header fields. *Thanks, as
- usual, to Andreas Koenig for spotting this one.*
-
- MIME::ParserBase no longer defaults to RFC-1522-decoding headers.
- The documentation correctly stated that the default setting was to
- *not* RFC-1522-decode the headers. The code, on the other hand, was
- init'ing this parser option in the "on" position. This has been
- fixed.
-
- MIME::ParserBase::parse_nested_messages reexamined. If you use this
- feature, please re-read the documentation. It explains a little more
- precisely what the ramifications are.
-
- MIME::Entity tries harder to ensure MIME compliance. It is now a
- fatal error to use certain bad combinations of content type and
- encoding when "building", or to attempt to "attach" to anything that
- is not a multipart document. My apologies if this inconveniences
- anyone, but it was just too darn easy before for folks to create bad
- MIME, and gosh darn it, good libraries should at least *try* to
- protect you from mistakes.
-
- The "make" now halts if you don't have the right stuff, provided
- your MakeMaker supports PREREQ_PM. See the section on "REQUIREMENTS"
- for what you need to install this package. I still provide old
- courtesy copies of the MIME:: decoding modules. *Thanks to Hugo van
- der Sanden for suggesting this.*
-
- The "make test" is far less chatty. Okay, okay, STDERR is evil. Now
- a `"make test"' will just give you the important stuff: do a `"make
- test TEST_VERBOSE=1"' if you want the gory details (advisable if
- sending me a bug report). *Thanks to Andreas Koenig for suggesting
- this.*
-
-Version 3.203
- No, there haven't been any major changes between 2.x and 3.x. The
- major-version increase was from a few more tweaks to get $VERSION to
- be calculated better and more efficiently (I had been using RCS
- version numbers in a way which created problems for users of
- CPAN::). After a couple of false starts, all modules have been
- upgraded to RCS 3.201 or higher.
-
- You can now parse a MIME message from a scalar, an array-of-scalars,
- or any MIME::IO-compliant object (including IO:: objects.) Take a
- look at parse_data() in MIME::ParserBase. The parser code has been
- modified to support the MIME::IO interface. *Thanks to fellow
- Chicagoan Tim Pierce (and countless others) for asking.*
-
- More sensible toolkit configuration. A new config() method in
- MIME::ToolUtils makes a lot of toolkit-wide configuration cleaner.
- Your old calls will still work, but with deprecation warnings.
-
- You can now sign messages just like in Mail::Internet. See
- MIME::Entity for the interface.
-
- You can now remove signatures from messages just like in
- Mail::Internet. See MIME::Entity for the interface.
-
- You can now compute/strip content lengths and other non-standard
- MIME fields. See sync_headers() in MIME::Entity. *Thanks to Tim
- Pierce for bringing the basic problem to my attention.*
-
- Many warnings are now silent unless $^W is true. That means unless
- you run your Perl with `-w', you won't see deprecation warnings,
- non-fatal-error messages, etc. But of course you run with `-w', so
- this doesn't affect you. `:-)'
-
- Completed the 7-bit encodings in MIME::Latin1. We hadn't had
- complete coverage in the conversion from 8- to 7-bit; now we do.
- *Thanks to Rolf Nelson for bringing this to my attention.*
-
- Fixed broken parse_two() in MIME::ParserBase. BTW, if your code
- worked with the "broken" code, it should *still* work. *Thanks again
- to Tim Pierce for bringing this to my attention.*
-
-Version 2.14
- Just a few bug fixes to improve compatibility with Mail-Tools 1.08,
- and with the upcoming Perl 5.004 release. *Thanks to Jason L.
- Tibbitts III for reporting the problems so quickly.*
-
-Version 2.13
- New features
- Added RFC-1522-style decoding of encoded header fields. Header
- decoding can now be done automatically during parsing via the
- new `decode()' method in MIME::Head... just tell your parser
- object that you want to `decode_headers()'. *Thanks to Kent
- Boortz for providing the idea, and the baseline RFC-1522-
- decoding code!*
-
- Building MIME messages is even easier. Now, when you use
- MIME::Entity's `build()' or `attach()', you can also supply
- individual mail headers to set (e.g., `-Subject', `-From', `-
- To').
-
- Added `Disposition' to MIME::Entity's `build()' method. *Thanks
- to Kurt Freytag for suggesting this feature.*
-
- An `X-Mailer' header is now output by default in all MIME-
- Entity-prepared messages, so any bad MIME we generate can be
- traced back to this toolkit.
-
- Added `purge()' method to MIME::Entity for deleteing leftover
- files. *Thanks to Jason L. Tibbitts III for suggesting this
- feature.*
-
- Added `seek()' and `tell()' methods to built-in MIME::IO
- classes. Only guaranteed to work when reading! *Thanks to Jason
- L. Tibbitts III for suggesting this feature.*
-
- When parsing a multipart message with apparently no boundaries,
- the error message you get has been improved. *Thanks to Andreas
- Koenig for suggesting this.*
-
- Bug fixes
- Patched over a Perl 5.002 (and maybe earlier and later) bug
- involving FileHandle::new_tmpfile. It seems that the underlying
- filehandles were not being closed when the FileHandle objects
- went out of scope! There is now an internal routine that creates
- true FileHandle objects for anonymous temp files. *Thanks to
- Dragomir R. Radev and Zyx for reporting the weird behavior that
- led to the discovery of this bug.*
-
- MIME::Entity's `build()' method now warns you if you give it an
- illegal boundary string, and substitutes one of its own.
-
- MIME::Entity's `build()' method now generates safer, fully-RFC-
- 1521-compliant boundary strings.
-
- Bug in MIME::Decoder's `install()' method was fixed. *Thanks to
- Rolf Nelson and Nickolay Saukh for finding this.*
-
- Changed FileHandle::new_tmpfile to FileHandle->new_tmpfile, so
- some Perl installations will be happier. *Thanks to Larry W.
- Virden for finding this bug.*
-
- Gave `=over' an arg of 4 in all PODs. *Thanks to Larry W. Virden
- for pointing out the problems of bare =over's*
-
-Version 2.04
- A bug in MIME::Entity's output method was corrected.
- MIME::Entity::print now outputs everything to the desired filehandle
- explicitly. *Thanks to Jake Morrison for pointing out the
- incompatibility with Mail::Header.*
-
-Version 2.03
- Fixed bug in autogenerated filenames resulting from transposed "if"
- statement in MIME::Parser, removing spurious printing of header as
- well. (Annoyingly, this bug is invisible if debugging is turned on!)
- *Thanks to Andreas Koenig for bringing this to my attention.*
-
- Fixed bug in MIME::Entity::body() where it was using the bodyhandle
- completely incorrectly. *Thanks to Joel Noble for bringing this to
- my attention.*
-
- Fixed MIME::Head::VERSION so CPAN:: is happier. *Thanks to Larry
- Virden for bringing this to my attention.*
-
- Fixed undefined-variable warnings when dumping skeleton (happened
- when there was no Subject: line) *Thanks to Joel Noble for bringing
- this to my attention.*
-
-Version 2.02
- Stupid, stupid bugs in both BASE64 encoding and decoding were fixed.
- *Thanks to Phil Abercrombie for locating them.*
-
-Version 2.01
- Modules now inherit from the new Mail:: modules! This means big
- changes in behavior.
-
- MIME::Parser can now store message data in-core. There were a *lot*
- of requests for this feature.
-
- MIME::Entity can now compose messages. There were a *lot* of
- requests for this feature.
-
- Added option to parse `"message/rfc822"' as a pseduo-multipart
- document. *Thanks to Andreas Koenig for suggesting this.*
-
-Version 1.13
- MIME::Head now no longer requires space after ":", although either a
- space or a tab after the ":" will be swallowed if there. *Thanks to
- Igor Starovoitov for pointing out this shortcoming.*
-
-Version 1.12
- Fixed bugs in parser where CRLF-terminated lines were blowing out
- the handling of preambles/epilogues. *Thanks to Russell Sutherland
- for reporting this bug.*
-
- Fixed idiotic is_multipart() bug. *Thanks to Andreas Koenig for
- noticing it.*
-
- Added untested binmode() calls to parser for DOS, etc. systems. No
- idea if this will work...
-
- Reorganized the output_path() methods to allow easy use of
- inheritance, as per Achim Bohnet's suggestion.
-
- Changed MIME::Head to report mime_type more accurately.
-
- POSIX module no longer loaded by Parser if perl >= 5.002. Hey,
- 5.001'ers: let me know if this breaks stuff, okay?
-
- Added unsupported ./examples directory.
-
-Version 1.11
- Converted over to using Makefile.PL. *Thanks to Andreas Koenig for
- the much-needed kick in the pants...*
-
- Added t/*.t files for testing. Eeeeeeeeeeeh...it's a start.
-
- Fixed bug in default parsing routine for generating output paths; it
- was warning about evil filenames if there simply *were* no
- recommended filenames. D'oh!
-
- Fixed redefined parts() method in Entity.
-
- Fixed bugs in Head where field name wasn't being case folded.
-
-Version 1.10
- A typo was causing the epilogue of an inner multipart message to be
- swallowed to the end of the OUTER multipart message; this has now
- been fixed. *Thanks to Igor Starovoitov for reporting this bug.*
-
- A bad regexp for parameter names was causing some parameters to be
- parsed incorrectly; this has also been fixed. *Thanks again to Igor
- Starovoitov for reporting this bug.*
-
- It is now possible to get full control of the filenaming algorithm
- before output files are generated, and the default algorithm is
- safer. *Thanks to Laurent Amon for pointing out the problems, and
- suggesting some solutions.*
-
- Fixed illegal "simple" multipart test file. D'OH!
-
-Version 1.9
- No changes: 1.8 failed CPAN registration
-
-Version 1.8
- Fixed incompatibility with 5.001 and FileHandle::new_tmpfile Added
- COPYING file, and improved README.
-
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/MANIFEST
^
|
@@ -1,5 +1,14 @@
-ChangeLog
COPYING
+ChangeLog
+INSTALLING
+MANIFEST
+MANIFEST.SKIP
+META.yml
+Makefile.PL
+README
+README-OR-DIE
+README.system
+examples/README
examples/mimeabuse
examples/mimedump
examples/mimeencode
@@ -10,31 +19,18 @@
examples/mimesend
examples/mimesender
examples/mimetour
-examples/README
-inc/Module/AutoInstall.pm
-inc/Module/Install.pm
-inc/Module/Install/AutoInstall.pm
-inc/Module/Install/Base.pm
-inc/Module/Install/Can.pm
-inc/Module/Install/Fetch.pm
-inc/Module/Install/Include.pm
-inc/Module/Install/Makefile.pm
-inc/Module/Install/Metadata.pm
-inc/Module/Install/Win32.pm
-inc/Module/Install/WriteAll.pm
-INSTALLING
lib/MIME/Body.pm
lib/MIME/Decoder.pm
lib/MIME/Decoder/Base64.pm
-lib/MIME/Decoder/Binary.pm
lib/MIME/Decoder/BinHex.pm
+lib/MIME/Decoder/Binary.pm
lib/MIME/Decoder/Gzip64.pm
lib/MIME/Decoder/NBit.pm
lib/MIME/Decoder/QuotedPrint.pm
lib/MIME/Decoder/UU.pm
lib/MIME/Entity.pm
-lib/MIME/Field/ContDisp.pm
lib/MIME/Field/ConTraEnc.pm
+lib/MIME/Field/ContDisp.pm
lib/MIME/Field/ContType.pm
lib/MIME/Field/ParamVal.pm
lib/MIME/Head.pm
@@ -45,31 +41,20 @@
lib/MIME/Tools.pm
lib/MIME/WordDecoder.pm
lib/MIME/Words.pm
-Makefile.PL
-MANIFEST
-META.yml
-README
-README-OR-DIE
-README.system
-t/02-kwalitee.t
-t/02-pod-coverage.t
-t/02-pod.t
-t/99-prepare.t
t/Body.t
-t/BodyPrint.t
t/Decoder.t
t/Entity.t
+t/ExtUtils/TBone.pm
t/Gauntlet.t
t/Globby.pm
t/Head.t
t/Misc.t
-t/Parser.t
t/ParserEncoded.t
t/ParserPreamble.t
+t/Parser.t
t/Ref.t
-t/Smtpsend.t
+t/Tmpfile.topt
t/WordDecoder.t
-t/WordEncoder.t
t/Words.t
testin/ak-0696.msg
testin/andreas-1296.txt
@@ -122,10 +107,10 @@
testin/x-gzip64.body
testin/x-gzip64.msg
testin/zeegee.gif.uu
+testmsgs/ak-0696.msg
testmsgs/ak-0696-nest.ref
testmsgs/ak-0696-none.ref
testmsgs/ak-0696-replace.ref
-testmsgs/ak-0696.msg
testmsgs/bluedot-postcard.msg
testmsgs/bluedot-postcard.ref
testmsgs/bluedot-simple.msg
@@ -134,8 +119,8 @@
testmsgs/dup-names.ref
testmsgs/empty-preamble.msg
testmsgs/frag.msg
-testmsgs/german-qp.msg
testmsgs/german.msg
+testmsgs/german-qp.msg
testmsgs/german.ref
testmsgs/hdr-fakeout.msg
testmsgs/hdr-fakeout.ref
@@ -148,16 +133,16 @@
testmsgs/multi-digest.msg
testmsgs/multi-digest.ref
testmsgs/multi-frag.msg
-testmsgs/multi-igor.msg
-testmsgs/multi-igor.ref
testmsgs/multi-igor2.msg
testmsgs/multi-igor2.ref
-testmsgs/multi-nested.msg
-testmsgs/multi-nested.ref
+testmsgs/multi-igor.msg
+testmsgs/multi-igor.ref
testmsgs/multi-nested2.msg
testmsgs/multi-nested2.ref
testmsgs/multi-nested3.msg
testmsgs/multi-nested3.ref
+testmsgs/multi-nested.msg
+testmsgs/multi-nested.ref
testmsgs/multi-simple.msg
testmsgs/multi-simple.ref
testmsgs/multi-weirdspace.msg
@@ -169,8 +154,8 @@
testmsgs/simple.msg
testmsgs/simple.ref
testmsgs/uu-junk-extracted.ref
-testmsgs/uu-junk-target.msg
testmsgs/uu-junk.msg
testmsgs/uu-junk.ref
+testmsgs/uu-junk-target.msg
testmsgs/uu-zeegee.msg
testmsgs/uu-zeegee.ref
|
[-]
[+]
|
Added |
MIME-tools-5.420.tar.bz2/MANIFEST.SKIP
^
|
@@ -0,0 +1 @@
+set-version.pl
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/META.yml
^
|
@@ -1,31 +1,18 @@
----
-abstract: Tools to manipulate MIME messages
-author: Eryq <eryq@zeegee.com>, David F. Skoll <dfs@roaringpenguin.com>, Dave O'Neill <dmo@roaringpenguin.com>
-build_requires:
- Test::More: 0
+# http://module-build.sourceforge.net/META-spec.html
+#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
+name: MIME-tools
+version: 5.420
+version_from: lib/MIME/Tools.pm
+installdirs: site
+requires:
+ File::Path: 1
+ File::Spec: 0.6
+ IO::Stringy: 1.211
+ Mail::Field: 1.05
+ Mail::Header: 1.01
+ Mail::Internet: 1.0203
+ MIME::Base64: 2.2
+ Test::More: 0
+
distribution_type: module
-generated_by: Module::Install version 0.67
-license: perl
-meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.3.html
- version: 1.3
-name: MIME-tools
-no_index:
- directory:
- - inc
- - t
-recommends:
- MIME::Base64: 3.03
-requires:
- File::Path: 1
- File::Spec: 0.6
- File::Temp: 0.18
- IO::File: 0
- IO::Handle: 0
- IO::Stringy: 2.11
- MIME::Base64: 2.2
- Mail::Field: 1.05
- Mail::Header: 1.01
- Mail::Internet: 1.0203
- perl: 5.8.0
-version: 5.426
+generated_by: ExtUtils::MakeMaker version 6.17
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/Makefile.PL
^
|
@@ -1,34 +1,91 @@
-use strict;
-use warnings;
-use inc::Module::Install;
-
-name 'MIME-tools';
-version_from 'lib/MIME/Tools.pm';
-author q{Eryq <eryq@zeegee.com>, David F. Skoll <dfs@roaringpenguin.com>, Dave O'Neill <dmo@roaringpenguin.com>};
-abstract 'Tools to manipulate MIME messages';
-license 'perl';
-
-# We require 5.8.x, for PerlIO support of "in memory" filehandles opened on scalars
-perl_version '5.008';
-
-# Runtime deps
-requires 'Mail::Header' => 1.01;
-requires 'Mail::Internet' => 1.0203;
-requires 'Mail::Field' => 1.05;
-
-# We prefer 3.03, but can work with 2.20
-requires 'MIME::Base64' => 2.20;
-recommends 'MIME::Base64' => 3.03;
-
-requires 'IO::File';
-requires 'IO::Handle';
-requires 'IO::Stringy' => 2.110;
-requires 'File::Spec' => 0.6;
-requires 'File::Path' => 1;
-requires 'File::Temp' => 0.18;
+#!/usr/bin/perl
+use ExtUtils::MakeMaker;
+
+# Do our own prerequisite checking
+# Stolen from Net::FTPServer which stole from libwww-perl
+my %modules =
+(
+ 'Mail::Header' => { min_version => "1.01" },
+ 'Mail::Internet' => { min_version => "1.0203" },
+ 'Mail::Field' => { min_version => "1.05" },
+ 'MIME::Base64' => { min_version => "2.20",
+ rec_version => "3.03" },
+ 'IO::Stringy' => { min_version => "1.211" },
+ 'File::Spec' => { min_version => "0.6" },
+ 'File::Path' => { min_version => "1" }
+ );
+
+my($m, $foundit, $foundrec, @missing);
+@missing = ();
+foreach $m (sort keys %modules) {
+ $foundit = 0;
+ $foundrec = 0;
+ my $min_ver = $modules{$m}{min_version};
+ my $rec_ver = $modules{$m}{rec_version};
+ if (defined($rec_ver)) {
+ print "Checking for module $m (version $rec_ver)... ";
+ my $eval = "require $m; $m->VERSION >= $rec_ver;";
+ my $r = eval($eval);
+ if ($@ || !$r) {
+ print "not found.\n --- Fallback: ";
+ } else {
+ $foundit = 1;
+ $foundrec = 1;
+ print "ok.\n";
+ }
+ }
+ if (!$foundit) {
+ print "Checking for module $m (version $min_ver)... ";
+ my $eval = "require $m; $m->VERSION >= $min_ver;";
+ my $r = eval($eval);
+ if ($@ || !$r) {
+ print "not found.\n";
+ } else {
+ $foundit = 1;
+ print "ok.\n";
+ }
+ }
+ if (defined($rec_ver) and $foundit and !$foundrec) {
+ print "\n *** Warning: We can work with version $min_ver of $m, but\n *** we recommend that you upgrade to version $rec_ver.\n\n";
+ if ($m eq "MIME::Base64") {
+ print " *** Note that if you type 'make test', then tests\n *** 4, 5 and 7-11 of t/Misc.t may fail because of the old version\n *** of $m\n";
+ }
+ }
+
+ push @missing, "$m: At least version $min_ver" unless $foundit;
+}
+
+if ($#missing >= 0) {
+ print "\n\n *** The following required modules are missing:\n";
+ foreach $m (@missing) {
+ print "$m\n";
+ }
+ print " *** Please install them before attempting to use MIME::Tools.\n";
+}
+
+# Why the PREREQ_PM below? For automated tools like CPAN that try to be
+# smart about following dependencies.
+WriteMakefile(
+ NAME => "MIME-tools",
+ VERSION_FROM => "lib/MIME/Tools.pm",
+ PREREQ_PM => {"Mail::Header" => 1.01,
+ "Mail::Internet" => 1.0203,
+ "Mail::Field" => 1.05,
+ "MIME::Base64" => 2.20,
+ "IO::Stringy" => 1.211,
+ "File::Spec" => 0.6,
+ "File::Path" => 1,
+ "Test::More" => 0,
+ },
+ AUTHOR => 'Eryq <eryq@zeegee.com>, David F. Skoll <dfs@roaringpenguin.com>',
+ ABSTRACT => 'Tools to manipulate MIME messages',
+ 'dist' => {
+ COMPRESS =>'gzip -f',
+ SUFFIX =>'gz',
+ },
+);
+
+
+
-# Build deps
-build_requires 'Test::More';
-auto_install;
-WriteAll;
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/README
^
|
@@ -660,6 +660,724 @@
If your project is using MIME-tools, it might not be a bad idea to find
out about those bugs *before* they become problems...
+VERSION
+ $Revision: 1.5 $
+
+CHANGE LOG
+ Version 5.411
+ Regenerated docs. Bug in HTML docs, now all fixed.
+
+ Version 5.410 (2000/11/23)
+ Better detection of evil filenames. Now we check for filenames which
+ are suspiciously long, and a new MIME::Filer::exorcise_filename()
+ method is used to try and remove the evil. *Thanks to Jason Haar for
+ the suggestion.*
+
+ Version 5.409 (2000/11/12)
+ Added functionality to MIME::WordDecoder, including support for
+ plain US-ASCII.
+
+ MIME::Tools::tmpopen() made more flexible. You can now override the
+ tmpfile-opening behavior.
+
+ Version 5.408 (2000/11/10)
+ Added new Beta unmime() mechanism. See the MIME::WordDecoder manpage
+ for full details. Also see the section on "Understand how
+ international characters are represented".
+
+ Version 5.405 (2000/11/05)
+ Added a purge() that does what people want it to. Now, when a parse
+ finishes and you want to delete everything that was created by it,
+ you can invoke `purge()' on the parser's filer. All
+ files/directories created during the last parse should vanish.
+ *Thanks to everyone who complained about MIME::Entity::purge.*
+
+ Version 5.404 (2000/11/04)
+ Added new automatic MIME-decoding of attachment filenames with
+ encoded (non-ASCII) characters. Hopefully this will do more good
+ than harm. The use of MIME::Parser::decode_headers() and
+ MIME::Head::decode() has been deprecated in favor of the new
+ MIME::Words "unmime" mechanism. Please see the "unmime" entry in the
+ MIME::Words manpage.
+
+ Added tolerance for unquoted =?...?= in param values. This is in
+ violation of the RFCs, but then, so are some MUAs. *Thanks to desti
+ for bringing this to my attention.*
+
+ Fixed supposedly-bad B-encoding. *Thanks to Otto Frost for bringing
+ this to my attention.*
+
+ Version 5.316 (2000/09/21)
+ Increased tolerance in MIME::Parser. Now will ignore bogus POP3
+ "+OK" line before header, as well as bogus mailbox "From " line
+ (both with warnings). *Thanks to Antony OSullivan (ajos1) for
+ suggesting this feature.*
+
+ Fixed small epilogue-related bug in MIME::Entity::print_body(). Now
+ it only outputs a final newline if the epilogue does not end in one
+ already. Support for checking the preamble/epilogue in regression
+ tests was also added. *Thanks to Lars Hecking for bringing this
+ issue up.*
+
+ Updated documentation. All module manual pages should now direct
+ readers to the main MIME-tools manual page.
+
+ Version 5.314 (2000/09/06)
+ Fixed Makefile.PL to have less-restrictive requirement for
+ File::Spec (0.6).
+
+ Version 5.313 (2000/09/05)
+ Fixed nasty bug with evil filenames. Certain evil filenames were
+ getting replaced by internally-generated filenames which were just
+ as evil... ouch! If your parser occasionally throws a fatal
+ exception with a "write-open" error message, then you have this bug.
+ *Thanks to Julian Field and Antony OSullivan (ajos1) for delivering
+ the evidence!*
+
+ Beware the doctor
+ who cures seasonal head cold
+ by killing patient
+
+ Improved naming of extracted files. If a filename is regarded as
+ evil, we guess that it might just be because of part information,
+ and attempt to find and use the final path element.
+
+ Simplified message logging and made it more consistent. For details,
+ see the section on "Message-logging".
+
+ Version 5.312 (2000/09/03)
+ Fixed a Perl 5.7 select() incompatibility which caused "make test"
+ to fail. *Thanks to Nick Ing-Simmons for the patch.*
+
+ Version 5.311 (2000/08/16)
+ Blind fix for Win32 uudecoding bug. A missing binmode seems to be
+ the culprit here; let's see if this fixes it. *Thanks to ajos1 for
+ finding the culprit!*
+
+ The carriage return
+ thumbs its nose at me, laughing:
+ DOS I/O *still* sucks
+
+ Version 5.310 (2000/08/15)
+ Fixed a bug in the back-compat output_prefix() method of
+ MIME::Parser. Basically, output prefixes were not being set through
+ this mechanism. *Thanks to ajos1 for the alert.*
+
+ shift @_, ### "shift at-underscore"
+ or @_ will have
+ bogus "self" object
+
+ Added some backcompat methods, like parse_FH(). *Thanks (and
+ apologies) to Alain Kotoujansky.*
+
+ Added filenames-with-spaces support to MIME::Decoder::UU. *Thanks to
+ Richard Pun for the suggestion.*
+
+ Version 5.305 (2000/07/20)
+ Added MIME::Entity::parts_DFS as convenient way to "get all parts".
+ *Thanks to Xavier Armengou for suggesting this method.*
+
+ Removed the Alpha notice. Still a few features to tweak, but those
+ will be minor.
+
+ Version 5.303 (2000/07/07)
+ Fixed output bugs in new Filers. Scads of them: bad handling of
+ filename collisions, bad implementation of output_under(), bad
+ linking to results, POD errors, you name it. If this had gone to
+ CPAN, I'd have issued a factory recall. `:-('
+
+ Errors, like beetles,
+ Multiply ferociously
+ In the small hours
+
+ Version 5.301 (2000/07/06)
+ READ ME BEFORE UPGRADING PAST THIS POINT! New MIME::Parser::Filer
+ class -- not fully backwards-compatible. In response to demand for
+ more-comprehensive file-output strategies, I have decided that the
+ best thing to do is to split all the file-output logic
+ (output_path(), evil_filename(), etc.) into its own separate class,
+ inheriting from the new MIME::Parser::Filer class. If you *override*
+ any of the following in a MIME::Parser subclass, you will need to
+ change your code accordingly:
+
+ evil_filename
+ output_dir
+ output_filename
+ output_path
+ output_prefix
+ output_under
+
+ My sincere apologies for any inconvenience this will cause, but it's
+ ultimately for the best, and is quite likely the last structural
+ change to 5.x. *Thanks to Tyson Ackland for all the ideas.*
+ Incidentally, the new code also fixes a bug where identically-named
+ files in the same message could clobber each other.
+
+ A message arrives:
+ "Here are three files, all named 'Foo'"
+ Only one survives. :-(
+
+ Fixed bug in MIME::Words header decoding. Underscores were not being
+ handled properly. *Thanks to Dominique Unruh and Doru Petrescu,* who
+ independently submitted the same fix within 2 hours of each other,
+ after this bug has lain dormant for months:
+
+ Two users, same bug,
+ same patch -- mere hours apart:
+ Truly, life is odd.
+
+ Removed escaping of underscore in regexps. Escaping the underscore
+ (\_) in regexps was sloppy and wrong (escaped metacharacters may
+ include anything in \w), and the newest Perls warn about it. *Thanks
+ to David Dyck for bringing this to my attention.*
+
+ What, then, is a word?
+ Some letters, digits, and, yes:
+ Underscores as well
+
+ Added Force option to MIME::Entity's make_multipart. *Thanks to Bob
+ Glickstein for suggesting this.*
+
+ Numerous fixlets to example code. *Thanks to Doru Petrescu for
+ these.*
+
+ Added REQUIREMENTS section in docs. Long-overdue. *Thanks to Ingo
+ Schmiegel for motivating this.*
+
+ Version 5.211 (2000/06/24)
+ Fixed auto-uudecode bug. Parser was failing with "part did not end
+ with expected boundary" error when uuencoded entity was a
+ *singlepart* message (ironically, uuencoded parts of multiparts
+ worked fine). *Thanks to Michael Mohlere for testing uudecode and
+ finding this.*
+
+ The hurrying bee
+ Flies far for nectar, missing
+ The nearest flowers
+
+ Say ten thousand times:
+ Complex cases may succeed
+ Where simple ones fail
+
+ Parse errors now generate warnings. Parser errors now cause warn()s
+ to be generated if they are not turned into fatal exceptions. This
+ might be a little redundant, seeing as they are available in the
+ "results", but parser-warnings already cause warn()s. I can always
+ put in a "quiet" switch if people complain.
+
+ Miscellaneous cleanup. Documentation of MIME::Parser improved
+ slightly, and a redundant warning was removed.
+
+ Version 5.210 (2000/06/20)
+ Change in "evil" filename. Made MIME::Parser's evil_filename
+ stricter by having it reject "path" characters: any of '/' '\' ':'
+ '[' ']'.
+
+ Just as with beauty
+ The eye of the beholder
+ Is where "evil" lives.
+
+ Documentation fixes. Corrected a number of docs in MIME::Entity
+ which were obsoleted in the transition from 4.x to 5.x. *Thanks to
+ Michael Fischer for pointing these out.* For this one, a special 5-
+ 5-5-5 Haiku of anagrams:
+
+ Documentation
+ in mutant code, O!
+ Edit -- no, CUT! [moan]
+ I meant to un-doc...
+
+ IO::Lines usage bug fixed. MIME::Entity was missing a "use
+ IO::Lines", which caused an exception when you tried to use the
+ body() method of MIME::Entity. *Thanks to Hideyo Imazu and Michael
+ Fischer for pointing this out.*
+
+ Bareword looks fine, but
+ Perl cries: "Whoa there... IO::Lines?
+ Never heard of it."
+
+ Version 5.209 (2000/06/10)
+ Autodetection of uuencode. You can now tell the parser to hunt for
+ uuencode inside what should be text parts. See extract_uuencode()
+ for full details. Beware: this is largely untested at the moment.
+ *Special thanks to Michael Mohlere at ADJE Webmail, who was the
+ first -- and most-insistent -- user to request this feature.*
+
+ Faster parsing. Sped up the MIME::Decoder::NBit decoder quite a bit
+ by using a variant of the chunking trick I used for
+ MIME::Decoder::Base64. I suspect that the same trick (reading a big
+ chunk plus the next line to get a big block of lines) would work
+ with MIME::Decoder::QuotedPrint, but I don't have the time or
+ resources to check that right now (tested contributions would be
+ welcome). NBit encoding is more-conveniently done line-by-line for
+ now, because individual line lengths must be checked.
+
+ Better use of core. MIME::Body::InCore is now used when you build()
+ an entity with the Data parameter, instead of MIME::Body::Scalar.
+
+ More documentation on toolkit configuration.
+
+ Version 5.207 (2000/06/09)
+ Fixed whine() bug in MIME::Parser where the "warning" method whine()
+ was called as a static function instead of invoked as an instance
+ method. *Thanks to Todd A. Bradfute for reporting this.*
+
+ A simple warning
+ Invokes method as function:
+ "Warning" makes us die
+
+ Version 5.206 (2000/06/08)
+ Ahem. Cough cough:
+
+ Way too many bugs
+ Thus, a self-imposed penance:
+ Write haiku for each
+
+ Fixed bug in MIME::Parser: the reader was not handling the odd (but
+ legal) case where a multipart boundary is followed by linear
+ whitespace. *Thanks to Jon Agnew for reporting this with the RFC
+ citation.*
+
+ Legal message fails
+ And 'round the globe, thousands cry:
+ READ THE RFC
+
+ Empty preambles are now handled properly by MIME::Entity when
+ printing: there is now no space between the header-terminator and
+ the initial boundary. *Thanks to "sen_ml" for suggesting this.*
+
+ Nature hates vacuum
+ But please refrain from tossing
+ Newlines in the void
+
+ Started using Benchmark for benchmarking.
+
+ Version 5.205 (2000/06/06)
+ Added terminating newline to all parser messages, and fixed small
+ parser bug that was dropping parts when errors occurred in certain
+ places.
+
+ Version 5.203 (2000/06/05)
+ Brand new parser based on new (private) MIME::Parser::Reader and
+ (public) MIME::Parser::Results. Fast and yet simple and very
+ tolerant of bad MIME when desired. Message reporting needs some
+ muzzling.
+
+ MIME::Parser now has ignore_errors() set true by default.
+
+ Version 5.116 (2000/05/26)
+ Removed Tmpfile.t test, which was causing a bogus failure in "make
+ test". Now we require 5.004 for MIME::Parser anyway, so we don't
+ need it. *Thanks to Jonathan Cohn for reporting this.*
+
+ Version 5.115 (2000/05/24)
+ Fixed Ref.t bug, and documented how to remove parts from a
+ MIME::Entity.
+
+ Version 5.114 (2000/05/23)
+ Entity now uses MIME::Lite-style default suggested encoding.
+
+ More regression test have been added, and the "Size" tests in Ref.t
+ are skipped for text document (due to CRLF differences between
+ platforms).
+
+ Version 5.113 (2000/05/21)
+ Major speed and structural improvements to the parser. *Major, MAJOR
+ thanks to Noel Burton-Krahn, Jeremy Gilbert, and Doru Petrescu for
+ all the patches, benchmarking, and Beta-testing!*
+
+ Convenient new one-directory-per-message parsing mechanism. Now
+ through `MIME::Parser' method `output_under()', you can tell the
+ parser that you want it to create a unique directory for each
+ message parsed, to hold the resulting parts.
+
+ Elimination of $', $` and $&. Wow... I still can't believe I missed
+ this. D'OH! *Thanks to Noel Burton-Krahn for all his patches.*
+
+ Parser is more tolerant of weird EOL termination. Some mailagents
+ are can terminate lines with "\r\r\n". We're okay with that now when
+ we extract the header. *Thanks to Joao Fonseca for pointing this
+ out.*
+
+ Parser is tolerant of "From " lines in headers. *Thanks to Joachim
+ Wieland, Anthony Hinsinger, Marius Stan, and numerous others.*
+
+ Parser catches syntax errors in headers. *Thanks to Russell P.
+ Sutherland for catching this.*
+
+ Parser no longer warns when subtype is undefined. *Thanks to Eric-
+ Olivier Le Bigot for his fix.*
+
+ Better integration with Mail::Internet. For example, smtpsend()
+ should work fine. *Thanks to Michael Fischer and others for the
+ patch.*
+
+ Miscellaneous cleanup. *Thanks to Marcus Brinkmann for additional
+ helpful input.* *Thanks to Klaus Seidenfaden for good feedback on
+ 5.x Alpha!*
+
+ Version 4.123 (1999/05/12)
+ Cleaned up some of the tests for non-Unix OS'es. Will require a few
+ iterations, no doubt.
+
+ Version 4.122 (1999/02/09)
+ Resolved CORE::open warnings for 5.005. *Thanks to several folks for
+ this bug report.*
+
+ Version 4.121 (1998/06/03)
+ Fixed MIME::Words infinite recursion. *Thanks to several folks for
+ this bug report.*
+
+ Version 4.117 (1998/05/01)
+ Nicer MIME::Entity::build. No longer outputs warnings with undefined
+ Filename, and now accepts Charset as well. *Thanks to Jason Tibbits
+ III for the inspirational patch.*
+
+ Documentation fixes. Hopefully we've seen the last of the pod2man
+ warnings...
+
+ Better test logging. Now uses ExtUtils::TBone.
+
+ Version 4.116 (1998/02/14)
+ Bug fix: MIME::Head and MIME::Entity were not downcasing the
+ content-type as they claimed. This has now been fixed. *Thanks to
+ Rodrigo de Almeida Siqueira for finding this.*
+
+ Version 4.114 (1998/02/12)
+ Gzip64-encoding has been improved, and turned off as a default,
+ since it depends on having gzip installed. See MIME::Decoder::Gzip64
+ if you want to activate it in your app. You can now set up the
+ gzip/gunzip commands to use, as well. *Thanks to Paul J. Schinder
+ for finding this bug.*
+
+ Version 4.113 (1998/01/20)
+ Bug fix: MIME::ParserBase was accidentally folding newlines in
+ header fields. *Thanks to Jason L. Tibbitts III for spotting this.*
+
+ Version 4.112 (1998/01/17)
+ MIME::Entity::print_body now recurses when printing multipart
+ entities, and prints "everything following the header." This is more
+ likely what people expect to happen. PLEASE read the "two body
+ problem" section of MIME::Entity's docs.
+
+ Version 4.111 (1998/01/14)
+ Clean build/test on Win95 using 5.004. Whew.
+
+ Version 4.110 (1998/01/11)
+ Added make_multipart() and make_singlepart() in MIME::Entity.
+
+ Improved handling/saving of preamble/epilogue.
+
+ Version 4.109 (1998/01/10)
+ Overall Major version shift to 4.x accompanies numerous structural changes,
+ and the deletion of some long-deprecated code. Many apologies to
+ those who are inconvenienced by the upgrade.
+
+ MIME::IO deprecated. You'll see IO::Scalar, IO::ScalarArray, and
+ IO::Wrap to make this toolkit work.
+
+ MIME::Entity deep code. You can now deep-copy MIME entities
+ (except for on-disk data files).
+
+ Encoding/decoding
+ MIME::Latin1 deprecated, and 8-to-7 mapping removed. Really,
+ MIME::Latin1 was one of my more dumber ideas. It's still there,
+ but if you want to map 8-bit characters to Latin1 ASCII
+ approximations when 7bit encoding, you'll have to request it
+ explicitly. *But use quoted-printable for your 8-bit documents;
+ that's what it's there for!*
+
+ 7bit and 8bit "encoders" no longer encode. As per RFC-2045,
+ these just do a pass-through of the data, but they'll warn you
+ if you send bad data through.
+
+ MIME::Entity suggests encoding. Now you can ask MIME::Entity's
+ build() method to "suggest" a legal encoding based on the body
+ and the content-type. No more guesswork! See the "mimesend"
+ example.
+
+ New module structure for MIME::Decoder classes. It should be
+ easier for you to see what's happening.
+
+ New MIME decoders! Support added for decoding `x-uuencode', and
+ for decoding/encoding `x-gzip64'. You'll need "gzip" to make the
+ latter work.
+
+ Quoted-printable back on track... and then some. The 'quoted-
+ printable' decoder now uses the newest MIME::QuotedPrint, and
+ amends its output with guideline #8 from RFC2049 (From/.).
+ *Thanks to Denis N. Antonioli for suggesting this.*
+
+ Parsing Preamble and epilogue are now saved. These are saved in the parsed
+ entities as simple string-arrays, and are output by print() if
+ there. *Thanks to Jason L. Tibbitts for suggesting this.*
+
+ The "multipart/digest" semantics are now preserved. Parts of
+ digest messages have their mime_type() defaulted to
+ "message/rfc822" instead of "text/plain", as per the RFC.
+ *Thanks to Carsten Heyl for suggesting this.*
+
+ Output Well-defined, more-complete print() output. When printing an entity,
+ the output is now well-defined if the entity came from a
+ MIME::Parser, even if using parse_nested_messages. See
+ MIME::Entity for details.
+
+ You can prevent recommended filenames from being output. This
+ possible security hole has been plugged; when building MIME
+ entities, you can specify a body path but suppress the filename
+ in the header. *Thanks to Jason L. Tibbitts for suggesting
+ this.*
+
+ Bug fixes
+ Win32 installations should work. The binmode() calls should work
+ fine on Win32 now. *Thanks to numerous folks for their patches.*
+
+ MIME::Head::add() now no longer downcases its argument. *Thanks
+ to Brandon Browning & Jason L. Tibbitts for finding this bug.*
+
+ Version 3.204
+ Bug in MIME::Head::original_text fixed. Well, it took a while, but
+ another bug surfaced from my transition from 1.x to 2.x. This method
+ was, quite idiotically, sorting the header fields. *Thanks, as
+ usual, to Andreas Koenig for spotting this one.*
+
+ MIME::ParserBase no longer defaults to RFC-1522-decoding headers.
+ The documentation correctly stated that the default setting was to
+ *not* RFC-1522-decode the headers. The code, on the other hand, was
+ init'ing this parser option in the "on" position. This has been
+ fixed.
+
+ MIME::ParserBase::parse_nested_messages reexamined. If you use this
+ feature, please re-read the documentation. It explains a little more
+ precisely what the ramifications are.
+
+ MIME::Entity tries harder to ensure MIME compliance. It is now a
+ fatal error to use certain bad combinations of content type and
+ encoding when "building", or to attempt to "attach" to anything that
+ is not a multipart document. My apologies if this inconveniences
+ anyone, but it was just too darn easy before for folks to create bad
+ MIME, and gosh darn it, good libraries should at least *try* to
+ protect you from mistakes.
+
+ The "make" now halts if you don't have the right stuff, provided
+ your MakeMaker supports PREREQ_PM. See the section on "REQUIREMENTS"
+ for what you need to install this package. I still provide old
+ courtesy copies of the MIME:: decoding modules. *Thanks to Hugo van
+ der Sanden for suggesting this.*
+
+ The "make test" is far less chatty. Okay, okay, STDERR is evil. Now
+ a `"make test"' will just give you the important stuff: do a `"make
+ test TEST_VERBOSE=1"' if you want the gory details (advisable if
+ sending me a bug report). *Thanks to Andreas Koenig for suggesting
+ this.*
+
+ Version 3.203
+ No, there haven't been any major changes between 2.x and 3.x. The
+ major-version increase was from a few more tweaks to get $VERSION to
+ be calculated better and more efficiently (I had been using RCS
+ version numbers in a way which created problems for users of
+ CPAN::). After a couple of false starts, all modules have been
+ upgraded to RCS 3.201 or higher.
+
+ You can now parse a MIME message from a scalar, an array-of-scalars,
+ or any MIME::IO-compliant object (including IO:: objects.) Take a
+ look at parse_data() in MIME::ParserBase. The parser code has been
+ modified to support the MIME::IO interface. *Thanks to fellow
+ Chicagoan Tim Pierce (and countless others) for asking.*
+
+ More sensible toolkit configuration. A new config() method in
+ MIME::ToolUtils makes a lot of toolkit-wide configuration cleaner.
+ Your old calls will still work, but with deprecation warnings.
+
+ You can now sign messages just like in Mail::Internet. See
+ MIME::Entity for the interface.
+
+ You can now remove signatures from messages just like in
+ Mail::Internet. See MIME::Entity for the interface.
+
+ You can now compute/strip content lengths and other non-standard
+ MIME fields. See sync_headers() in MIME::Entity. *Thanks to Tim
+ Pierce for bringing the basic problem to my attention.*
+
+ Many warnings are now silent unless $^W is true. That means unless
+ you run your Perl with `-w', you won't see deprecation warnings,
+ non-fatal-error messages, etc. But of course you run with `-w', so
+ this doesn't affect you. `:-)'
+
+ Completed the 7-bit encodings in MIME::Latin1. We hadn't had
+ complete coverage in the conversion from 8- to 7-bit; now we do.
+ *Thanks to Rolf Nelson for bringing this to my attention.*
+
+ Fixed broken parse_two() in MIME::ParserBase. BTW, if your code
+ worked with the "broken" code, it should *still* work. *Thanks again
+ to Tim Pierce for bringing this to my attention.*
+
+ Version 2.14
+ Just a few bug fixes to improve compatibility with Mail-Tools 1.08,
+ and with the upcoming Perl 5.004 release. *Thanks to Jason L.
+ Tibbitts III for reporting the problems so quickly.*
+
+ Version 2.13
+ New features
+ Added RFC-1522-style decoding of encoded header fields. Header
+ decoding can now be done automatically during parsing via the
+ new `decode()' method in MIME::Head... just tell your parser
+ object that you want to `decode_headers()'. *Thanks to Kent
+ Boortz for providing the idea, and the baseline RFC-1522-
+ decoding code!*
+
+ Building MIME messages is even easier. Now, when you use
+ MIME::Entity's `build()' or `attach()', you can also supply
+ individual mail headers to set (e.g., `-Subject', `-From', `-
+ To').
+
+ Added `Disposition' to MIME::Entity's `build()' method. *Thanks
+ to Kurt Freytag for suggesting this feature.*
+
+ An `X-Mailer' header is now output by default in all MIME-
+ Entity-prepared messages, so any bad MIME we generate can be
+ traced back to this toolkit.
+
+ Added `purge()' method to MIME::Entity for deleteing leftover
+ files. *Thanks to Jason L. Tibbitts III for suggesting this
+ feature.*
+
+ Added `seek()' and `tell()' methods to built-in MIME::IO
+ classes. Only guaranteed to work when reading! *Thanks to Jason
+ L. Tibbitts III for suggesting this feature.*
+
+ When parsing a multipart message with apparently no boundaries,
+ the error message you get has been improved. *Thanks to Andreas
+ Koenig for suggesting this.*
+
+ Bug fixes
+ Patched over a Perl 5.002 (and maybe earlier and later) bug
+ involving FileHandle::new_tmpfile. It seems that the underlying
+ filehandles were not being closed when the FileHandle objects
+ went out of scope! There is now an internal routine that creates
+ true FileHandle objects for anonymous temp files. *Thanks to
+ Dragomir R. Radev and Zyx for reporting the weird behavior that
+ led to the discovery of this bug.*
+
+ MIME::Entity's `build()' method now warns you if you give it an
+ illegal boundary string, and substitutes one of its own.
+
+ MIME::Entity's `build()' method now generates safer, fully-RFC-
+ 1521-compliant boundary strings.
+
+ Bug in MIME::Decoder's `install()' method was fixed. *Thanks to
+ Rolf Nelson and Nickolay Saukh for finding this.*
+
+ Changed FileHandle::new_tmpfile to FileHandle->new_tmpfile, so
+ some Perl installations will be happier. *Thanks to Larry W.
+ Virden for finding this bug.*
+
+ Gave `=over' an arg of 4 in all PODs. *Thanks to Larry W. Virden
+ for pointing out the problems of bare =over's*
+
+ Version 2.04
+ A bug in MIME::Entity's output method was corrected.
+ MIME::Entity::print now outputs everything to the desired filehandle
+ explicitly. *Thanks to Jake Morrison for pointing out the
+ incompatibility with Mail::Header.*
+
+ Version 2.03
+ Fixed bug in autogenerated filenames resulting from transposed "if"
+ statement in MIME::Parser, removing spurious printing of header as
+ well. (Annoyingly, this bug is invisible if debugging is turned on!)
+ *Thanks to Andreas Koenig for bringing this to my attention.*
+
+ Fixed bug in MIME::Entity::body() where it was using the bodyhandle
+ completely incorrectly. *Thanks to Joel Noble for bringing this to
+ my attention.*
+
+ Fixed MIME::Head::VERSION so CPAN:: is happier. *Thanks to Larry
+ Virden for bringing this to my attention.*
+
+ Fixed undefined-variable warnings when dumping skeleton (happened
+ when there was no Subject: line) *Thanks to Joel Noble for bringing
+ this to my attention.*
+
+ Version 2.02
+ Stupid, stupid bugs in both BASE64 encoding and decoding were fixed.
+ *Thanks to Phil Abercrombie for locating them.*
+
+ Version 2.01
+ Modules now inherit from the new Mail:: modules! This means big
+ changes in behavior.
+
+ MIME::Parser can now store message data in-core. There were a *lot*
+ of requests for this feature.
+
+ MIME::Entity can now compose messages. There were a *lot* of
+ requests for this feature.
+
+ Added option to parse `"message/rfc822"' as a pseduo-multipart
+ document. *Thanks to Andreas Koenig for suggesting this.*
+
+ Version 1.13
+ MIME::Head now no longer requires space after ":", although either a
+ space or a tab after the ":" will be swallowed if there. *Thanks to
+ Igor Starovoitov for pointing out this shortcoming.*
+
+ Version 1.12
+ Fixed bugs in parser where CRLF-terminated lines were blowing out
+ the handling of preambles/epilogues. *Thanks to Russell Sutherland
+ for reporting this bug.*
+
+ Fixed idiotic is_multipart() bug. *Thanks to Andreas Koenig for
+ noticing it.*
+
+ Added untested binmode() calls to parser for DOS, etc. systems. No
+ idea if this will work...
+
+ Reorganized the output_path() methods to allow easy use of
+ inheritance, as per Achim Bohnet's suggestion.
+
+ Changed MIME::Head to report mime_type more accurately.
+
+ POSIX module no longer loaded by Parser if perl >= 5.002. Hey,
+ 5.001'ers: let me know if this breaks stuff, okay?
+
+ Added unsupported ./examples directory.
+
+ Version 1.11
+ Converted over to using Makefile.PL. *Thanks to Andreas Koenig for
+ the much-needed kick in the pants...*
+
+ Added t/*.t files for testing. Eeeeeeeeeeeh...it's a start.
+
+ Fixed bug in default parsing routine for generating output paths; it
+ was warning about evil filenames if there simply *were* no
+ recommended filenames. D'oh!
+
+ Fixed redefined parts() method in Entity.
+
+ Fixed bugs in Head where field name wasn't being case folded.
+
+ Version 1.10
+ A typo was causing the epilogue of an inner multipart message to be
+ swallowed to the end of the OUTER multipart message; this has now
+ been fixed. *Thanks to Igor Starovoitov for reporting this bug.*
+
+ A bad regexp for parameter names was causing some parameters to be
+ parsed incorrectly; this has also been fixed. *Thanks again to Igor
+ Starovoitov for reporting this bug.*
+
+ It is now possible to get full control of the filenaming algorithm
+ before output files are generated, and the default algorithm is
+ safer. *Thanks to Laurent Amon for pointing out the problems, and
+ suggesting some solutions.*
+
+ Fixed illegal "simple" multipart test file. D'OH!
+
+ Version 1.9
+ No changes: 1.8 failed CPAN registration
+
+ Version 1.8
+ Fixed incompatibility with 5.001 and FileHandle::new_tmpfile Added
+ COPYING file, and improved README.
+
AUTHOR
MIME-tools was created by:
@@ -711,8 +1429,8 @@
me, and I'll put you in.
SEE ALSO
- At the time of this writing the MIME-tools homepage was
- http://www.mimedefang.org/static/mime-tools.php.
+ At the time of this writing ($Date: 2005/01/05 02:46:45 $), the MIME-
+ tools homepage was http://www.mimedefang.org/static/mime-tools.php.
Check there for updates and support.
Users of this toolkit may wish to read the documentation of Mail::Header
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Body.pm
^
|
@@ -1,5 +1,6 @@
package MIME::Body;
+
=head1 NAME
MIME::Body - the body of a MIME message
@@ -137,11 +138,11 @@
use vars qw($VERSION);
### System modules:
+use IO::Scalar;
use Carp;
-use IO::File;
### The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.426";
+$VERSION = "5.420";
#------------------------------
@@ -213,9 +214,8 @@
sub as_string {
my $self = shift;
my $str = '';
- my $fh = IO::File->new(\$str, '>:') or croak("Cannot open in-memory file: $!");
- $self->print($fh);
- close($fh);
+ my $out = new IO::Scalar \$str;
+ $self->print($out);
return $str;
}
*data = \&as_string; ### silenty invoke preferred usage
@@ -328,7 +328,7 @@
my $nread;
### Get output filehandle, and ensure that it's a printable object:
- $fh ||= select;
+ $fh = IO::Wrap::wraphandle($fh || select);
### Write it:
my $buf = '';
@@ -365,8 +365,8 @@
class: data in: returns:
--------------------------------------------------------
MIME::Body::File disk file IO::Handle
- MIME::Body::Scalar scalar IO::Handle
- MIME::Body::InCore scalar array IO::Handle
+ MIME::Body::Scalar scalar IO::Scalar
+ MIME::Body::InCore scalar array IO::ScalarArray
=cut
@@ -377,8 +377,8 @@
=head2 MIME::Body::File
-A body class that stores the data in a disk file. Invoke the
-constructor as:
+A body class that stores the data in a disk file.
+The I/O handle is a wrapped filehandle. Invoke the constructor as:
$body = new MIME::Body::File "/path/to/file";
@@ -403,10 +403,11 @@
use strict;
### System modules:
-use IO::File;
+require FileHandle;
### Kit modules:
use MIME::Tools qw(whine);
+use IO::Wrap;
@ISA = qw(MIME::Body);
@@ -425,18 +426,19 @@
#------------------------------
sub open {
my ($self, $mode) = @_;
-
+ my $IO;
my $path = $self->path;
-
- if( $mode ne 'r' && $mode ne 'w' ) {
+ if ($mode eq 'w') { ### writing
+ $IO = FileHandle->new(">$path") || die "write-open $path: $!";
+ }
+ elsif ($mode eq 'r') { ### reading
+ $IO = FileHandle->new("<$path") || die "read-open $path: $!";
+ }
+ else {
die "bad mode: '$mode'";
}
-
- my $IO = IO::File->new($path, $mode) || die "MIME::Body::File->open $path: $!";
-
- $IO->binmode() if $self->binmode;
-
- return $IO;
+ binmode($IO) if $self->binmode; ### set binary read/write mode?
+ return (IO::Wrap::wraphandle($IO)); ### wrap if old FileHandle class
}
#------------------------------
@@ -480,11 +482,16 @@
"Line 2\n",
"Line 3"];
+Uses B<IO::Scalar> as the I/O handle.
+
=cut
use vars qw(@ISA);
use strict;
+require FileHandle;
+
+use IO::Scalar;
use Carp;
@ISA = qw(MIME::Body);
@@ -513,16 +520,7 @@
sub open {
my ($self, $mode) = @_;
$self->{MBS_Data} = '' if ($mode eq 'w'); ### writing
-
- if ($mode eq 'w') {
- $mode = '>:';
- } elsif ($mode eq 'r') {
- $mode = '<:';
- } else {
- die "bad mode: $mode";
- }
-
- return IO::File->new(\($self->{MBS_Data}), $mode);
+ return new IO::Scalar \($self->{MBS_Data});
}
@@ -545,7 +543,7 @@
A simple scalar argument sets the body to that value, exactly as though
you'd opened for the body for writing, written the value,
and closed the body again:
-
+
$body = new MIME::Body::InCore "Line 1\nLine 2\nLine 3";
A single array reference sets the body to the concatenation of all
@@ -555,14 +553,19 @@
"Line 2\n",
"Line 3"];
+Uses B<IO::ScalarArray> as the I/O handle.
+
=cut
use vars qw(@ISA);
use strict;
+require FileHandle;
+
+use IO::ScalarArray;
use Carp;
-@ISA = qw(MIME::Body::Scalar);
+@ISA = qw(MIME::Body);
#------------------------------
@@ -571,16 +574,16 @@
sub init {
my ($self, $data) = @_;
if (!defined($data)) { ### nothing
- $self->{MBS_Data} = '';
+ $self->{MBC_Data} = [];
}
elsif (!ref($data)) { ### simple scalar
- $self->{MBS_Data} = $data;
+ $self->{MBC_Data} = [ $data ];
}
elsif (ref($data) eq 'SCALAR') {
- $self->{MBS_Data} = $$data;
+ $self->{MBC_Data} = [ $$data ];
}
elsif (ref($data) eq 'ARRAY') {
- $self->{MBS_Data} = join('', @$data);
+ $self->{MBC_Data} = $data;
}
else {
croak "I can't handle DATA which is a ".ref($data)."\n";
@@ -588,6 +591,24 @@
$self;
}
+#------------------------------
+# as_string
+#------------------------------
+sub as_string {
+ my $self = shift;
+ return join '', @{$self->{MBC_Data}};
+}
+
+#------------------------------
+# open READWRITE
+#------------------------------
+sub open {
+ my ($self, $mode) = @_;
+ $self->{MBC_Data} = [] if ($mode eq 'w'); ### writing
+ return new IO::ScalarArray $self->{MBC_Data};
+}
+
+
1;
__END__
@@ -629,10 +650,10 @@
=head1 NOTES
-One reason I didn't just use IO::Handle objects for message bodies was
-that I wanted a "body" object to be a form of completely encapsulated
-program-persistent storage; that is, I wanted users to be able to write
-code like this...
+One reason I didn't just use FileHandle or IO::Handle objects for message
+bodies was that I wanted a "body" object to be a form of completely
+encapsulated program-persistent storage; that is, I wanted users
+to be able to write code like this...
### Get body handle from this MIME message, and read its data:
$body = $entity->bodyhandle;
@@ -665,6 +686,14 @@
Thanks to Achim Bohnet for suggesting that MIME::Parser not be restricted
to the use of FileHandles.
+
+
+=head1 VERSION
+
+$Revision: 1.13 $ $Date: 2006/03/17 21:03:23 $
+
+=cut
+
#------------------------------
1;
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Decoder.pm
^
|
@@ -85,11 +85,12 @@
use vars qw($VERSION %DecoderFor);
### System modules:
-use IPC::Open2;
use FileHandle;
+use IPC::Open2;
### Kit modules:
use MIME::Tools qw(:config :msgs);
+use IO::Wrap;
use Carp;
#------------------------------
@@ -125,7 +126,7 @@
);
### The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.426";
+$VERSION = "5.420";
### Me:
my $ME = 'MIME::Decoder';
@@ -160,22 +161,18 @@
sub new {
my ($class, @args) = @_;
my ($encoding) = @args;
+ my ($concrete_name, $concrete_path);
### Coerce the type to be legit:
$encoding = lc($encoding || '');
### Get the class:
- my $concrete_name = $DecoderFor{$encoding};
-
- if( ! $concrete_name ) {
- carp "no decoder for $encoding";
- return undef;
- }
+ ($concrete_name = $DecoderFor{$encoding}) or return undef;
+ ($concrete_path = $concrete_name.'.pm') =~ s{::}{/}g;
### Create the new object (if we can):
my $self = { MD_Encoding => lc($encoding) };
- unless (eval "require $concrete_name;") {
- carp $@;
+ unless (eval "require '$concrete_path';") {
return undef;
}
bless $self, $concrete_name;
@@ -229,6 +226,10 @@
### Set up the default input record separator to be CRLF:
### $in->input_record_separator("\012\015");
+ ### Coerce old-style filehandles to legit objects, and do it!
+ $in = wraphandle($in);
+ $out = wraphandle($out);
+
### Invoke back-end method to do the work:
$self->decode_it($in, $out) ||
die "$ME: ".$self->encoding." decoding failed\n";
@@ -254,6 +255,10 @@
sub encode {
my ($self, $in, $out, $textual_type) = @_;
+ ### Coerce old-style filehandles to legit objects, and do it!
+ $in = wraphandle($in);
+ $out = wraphandle($out);
+
### Invoke back-end method to do the work:
$self->encode_it($in, $out, $self->encoding eq 'quoted-printable' ? ($textual_type) : ()) ||
die "$ME: ".$self->encoding." encoding failed\n";
@@ -421,6 +426,10 @@
my ($self, $in, $out, @cmd) = @_;
my $buf = '';
+ ### Make sure we've got MIME::IO-compliant objects:
+ $in = wraphandle($in);
+ $out = wraphandle($out);
+
### Open pipe:
STDOUT->flush; ### very important, or else we get duplicate output!
my $kidpid = open2(\*CHILDOUT, \*CHILDIN, @cmd) || die "open2 failed: $!";
@@ -537,6 +546,11 @@
getline
read(BUF,NBYTES)
+For backwards compatibilty, if you supply a scalar filehandle name
+(like C<"STDOUT">) or an unblessed glob reference (like C<\*STDOUT>)
+where an INSTREAM or OUTSTREAM is expected, this package will
+automatically wrap it in an object that fits these criteria, via IO::Wrap.
+
I<Thanks to Achim Bohnet for suggesting this more-generic I/O model.>
@@ -622,4 +636,11 @@
All rights reserved. This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
+
+=head1 VERSION
+
+$Revision: 1.16 $ $Date: 2006/03/17 21:03:23 $
+
+=cut
+
1;
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Decoder/Base64.pm
^
|
@@ -30,10 +30,8 @@
When B<encoding>, the input is read 45 bytes at a time: this ensures
that the output lines are not too long. We chose 45 since it is
-a multiple of 3 and produces lines under 76 characters, as RFC 2045
-specifies:
- The encoded output stream must be represented in lines of no more
- than 76 characters each.
+a multiple of 3 and produces lines under 76 characters, as RFC-1521
+specifies.
=back
@@ -45,6 +43,11 @@
All rights reserved. This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
+
+=head1 VERSION
+
+$Revision: 1.10 $ $Date: 2006/03/17 21:03:23 $
+
=cut
use vars qw(@ISA $VERSION);
@@ -55,7 +58,7 @@
@ISA = qw(MIME::Decoder);
### The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.426";
+$VERSION = "5.420";
### How many bytes to encode at a time (must be a multiple of 3, and
### less than (76 * 0.75)!
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Decoder/BinHex.pm
^
|
@@ -30,6 +30,10 @@
All rights reserved. This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
+=head1 VERSION
+
+$Revision: 1.17 $ $Date: 2006/03/17 21:03:23 $
+
=cut
@@ -42,7 +46,7 @@
@ISA = qw(MIME::Decoder);
# The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.426";
+$VERSION = "5.420";
#------------------------------
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Decoder/Binary.pm
^
|
@@ -33,6 +33,11 @@
All rights reserved. This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
+
+=head1 VERSION
+
+$Revision: 1.10 $ $Date: 2006/03/17 21:03:23 $
+
=cut
use MIME::Decoder;
@@ -41,7 +46,7 @@
@ISA = qw(MIME::Decoder);
### The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.426";
+$VERSION = "5.420";
### Buffer length:
my $BUFLEN = 8192;
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Decoder/Gzip64.pm
^
|
@@ -43,22 +43,26 @@
it and/or modify it under the same terms as Perl itself.
+=head1 VERSION
+
+$Revision: 1.10 $ $Date: 2006/03/17 21:03:23 $
+
=cut
require 5.002;
-use strict;
-use vars qw(@ISA $VERSION $GZIP $GUNZIP);
+use vars qw(@ISA $VERSION $ZIP $UNZIP);
use MIME::Decoder;
use MIME::Base64;
use MIME::Decoder::Base64;
use MIME::Tools qw(tmpopen whine);
+use IO::Wrap;
# Inheritance:
@ISA = qw(MIME::Decoder::Base64);
# The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.426";
+$VERSION = "5.420";
# How to compress stdin to stdout:
$GZIP = "gzip -c";
@@ -75,7 +79,7 @@
my ($self, $in, $out) = @_;
# Open a temp file (assume the worst, that this is a big stream):
- my $tmp = tmpopen() || die "can't get temp file";
+ my $tmp = wraphandle(tmpopen() || die "can't get temp file");
# Stage 1: decode the base64'd stream into zipped data:
$self->SUPER::decode_it($in, $tmp) or die "base64 decoding failed!";
@@ -94,7 +98,7 @@
whine "Encoding ", $self->encoding, " is not standard MIME!";
# Open a temp file (assume the worst, that this is a big stream):
- my $tmp = tmpopen() || die "can't get temp file";
+ my $tmp = wraphandle(tmpopen() || die "can't get temp file");
# Stage 1: zip the raw data:
$self->filter($in, $tmp, $GZIP) or die "gzip encoding failed!";
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Decoder/NBit.pm
^
|
@@ -82,6 +82,12 @@
All rights reserved. This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
+
+=head1 VERSION
+
+$Revision: 1.10 $ $Date: 2006/03/17 21:03:23 $
+
+
=cut
use vars qw(@ISA $VERSION);
@@ -92,7 +98,7 @@
@ISA = qw(MIME::Decoder);
### The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.426";
+$VERSION = "5.420";
### How many bytes to decode at a time?
my $DecodeChunkLength = 8 * 1024;
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Decoder/QuotedPrint.pm
^
|
@@ -44,6 +44,12 @@
All rights reserved. This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
+
+=head1 VERSION
+
+$Revision: 1.21 $ $Date: 2006/03/17 21:03:23 $
+
+
=cut
use vars qw(@ISA $VERSION);
@@ -53,7 +59,7 @@
@ISA = qw(MIME::Decoder);
# The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.426";
+$VERSION = "5.420";
#------------------------------
# If we have MIME::QuotedPrint 3.03 or later, use the three-argument
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Decoder/UU.pm
^
|
@@ -33,6 +33,11 @@
All rights reserved. This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
+
+=head1 VERSION
+
+$Revision: 1.11 $ $Date: 2006/03/17 21:03:23 $
+
=cut
@@ -44,7 +49,7 @@
@ISA = qw(MIME::Decoder);
# The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.426";
+$VERSION = "5.420";
#------------------------------
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Entity.pm
^
|
@@ -8,7 +8,7 @@
=head1 SYNOPSIS
-Before reading further, you should see L<MIME::Tools> to make sure that
+Before reading further, you should see L<MIME::Tools> to make sure that
you understand where this module fits into the grand scheme of things.
Go on, do it now. I'll wait.
@@ -19,15 +19,15 @@
To => 'you@yourhost.com',
Subject => "Hello, nurse!",
Data => \@my_message);
-
+
### Attach stuff to it:
$top->attach(Path => $gif_path,
Type => "image/gif",
Encoding => "base64");
-
+
### Sign it:
$top->sign;
-
+
### Output it:
$top->print(\*STDOUT);
@@ -37,14 +37,14 @@
A subclass of B<Mail::Internet>.
This package provides a class for representing MIME message entities,
-as specified in RFCs 2045, 2046, 2047, 2048 and 2049.
+as specified in RFC 1521, I<Multipurpose Internet Mail Extensions>.
=head1 EXAMPLES
=head2 Construction examples
-Create a document for an ordinary 7-bit ASCII text file (lots of
+Create a document for an ordinary 7-bit ASCII text file (lots of
stuff is defaulted for us):
$ent = MIME::Entity->build(Path=>"english-msg.txt");
@@ -81,15 +81,15 @@
From => 'me@myhost.com',
To => 'you@yourhost.com',
Subject => "Hello, nurse!");
-
- ### Attachment #1: a simple text document:
+
+ ### Attachment #1: a simple text document:
$top->attach(Path=>"./testin/short.txt");
-
+
### Attachment #2: a GIF file:
$top->attach(Path => "./docs/mime-sm.gif",
Type => "image/gif",
Encoding => "base64");
-
+
### Attachment #3: text we'll create with text we have on-hand:
$top->attach(Data => $contents);
@@ -100,31 +100,31 @@
To => 'you@yourhost.com',
Subject => "Hello, nurse!",
Data => \@my_message);
- if ($GIF_path) {
+ if ($GIF_path) {
$top->attach(Path => $GIF_path,
Type => 'image/gif');
}
Copy an entity (headers, parts... everything but external body data):
- my $deepcopy = $top->dup;
+ my $deepcopy = $top->dup;
-=head2 Access examples
+=head2 Access examples
### Get the head, a MIME::Head:
$head = $ent->head;
-
+
### Get the body, as a MIME::Body;
$bodyh = $ent->bodyhandle;
-
+
### Get the intended MIME type (as declared in the header):
$type = $ent->mime_type;
-
+
### Get the effective MIME type (in case decoding failed):
$eff_type = $ent->effective_type;
-
+
### Get preamble, parts, and epilogue:
$preamble = $ent->preamble; ### ref to array of lines
$num_parts = $ent->parts;
@@ -141,13 +141,13 @@
while (defined($_ = $io->getline)) { print $_ }
$io->close;
}
-
+
### Write the (unencoded) body data:
if ($io = $ent->open("w")) {
foreach (@lines) { $io->print($_) }
$io->close;
}
-
+
### Delete the files for any external (on-disk) data:
$ent->purge;
@@ -155,7 +155,7 @@
### Sign it (automatically removes any existing signature):
$top->sign(File=>"$ENV{HOME}/.signature");
-
+
### Remove any signature within 15 lines of the end:
$top->remove_sig(15);
@@ -169,7 +169,7 @@
### If a 0- or 1-part multipart, collapse to a singlepart:
$top->make_singlepart;
-
+
### If a singlepart, inflate to a multipart with 1 part:
$top->make_multipart;
@@ -177,7 +177,7 @@
### Delete some parts of a multipart message:
my @keep = grep { keep_part($_) } $msg->parts;
- $msg->parts(\@keep);
+ $msg->parts(\@keep);
=head2 Output examples
@@ -186,10 +186,10 @@
### Print the entire message:
$top->print(\*STDOUT);
-
+
### Print just the header:
- $top->print_header(\*STDOUT);
-
+ $top->print_header(\*STDOUT);
+
### Print just the (encoded) body... includes parts as well!
$top->print_body(\*STDOUT);
@@ -198,10 +198,10 @@
### Stringify the entire message:
print $top->stringify; ### or $top->as_string
-
+
### Stringify just the header:
print $top->stringify_header; ### or $top->header_as_string
-
+
### Stringify just the (encoded) body... includes parts as well!
print $top->stringify_body; ### or $top->body_as_string
@@ -219,10 +219,11 @@
#------------------------------
### Pragmas:
-use vars qw(@ISA $VERSION);
+use vars qw(@ISA $VERSION);
use strict;
### System modules:
+use FileHandle;
use Carp;
### Other modules:
@@ -234,6 +235,8 @@
use MIME::Head;
use MIME::Body;
use MIME::Decoder;
+use IO::ScalarArray;
+use IO::Wrap;
use IO::Lines;
@ISA = qw(Mail::Internet);
@@ -246,7 +249,7 @@
#------------------------------
### The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.426";
+$VERSION = "5.420";
### Boundary counter:
my $BCount = 0;
@@ -254,13 +257,13 @@
### Standard "Content-" MIME fields, for scrub():
my $StandardFields = 'Description|Disposition|Id|Type|Transfer-Encoding';
-### Known Mail/MIME fields... these, plus some general forms like
+### Known Mail/MIME fields... these, plus some general forms like
### "x-*", are recognized by build():
-my %KnownField = map {$_=>1}
+my %KnownField = map {$_=>1}
qw(
- bcc cc comments date encrypted
+ bcc cc comments date encrypted
from keywords message-id mime-version organization
- received references reply-to return-path sender
+ received references reply-to return-path sender
subject to
);
@@ -293,10 +296,7 @@
# This is used both internally and by MIME::ParserBase, but it is NOT in
# the public interface! Do not use it!
#
-# We generate one containing a "=_", as RFC2045 suggests:
-# A good strategy is to choose a boundary that includes a character
-# sequence such as "=_" which can never appear in a quoted-printable
-# body. See the definition of multipart messages in RFC 2046.
+# We generate one containing a "=_", as RFC1521 suggests.
#
sub make_boundary {
return "----------=_".scalar(time)."-$$-".$BCount++;
@@ -328,7 +328,7 @@
that will be used to create both the header and an in-core body.
Else, if SOURCE is defined, it is assumed to be a filehandle
-from which the header and in-core body is to be read.
+from which the header and in-core body is to be read.
B<Note:> in either case, the body will not be I<parsed:> merely read!
@@ -384,11 +384,11 @@
$entity->add_part(ref($entity)->build(PARAMHASH, Top=>0));
-B<Note:> normally, you attach to multipart entities; however, if you
+B<Note:> normally, you attach to multipart entities; however, if you
attach something to a singlepart (like attaching a GIF to a text
message), the singlepart will be coerced into a multipart automatically.
-=cut
+=cut
sub attach {
my $self = shift;
@@ -416,7 +416,7 @@
Boundary => "---1234567");
A minimal MIME header will be created. If you want to add or modify
-any header fields afterwards, you can of course do so via the underlying
+any header fields afterwards, you can of course do so via the underlying
head object... but hey, there's now a prettier syntax!
$ent = MIME::Entity->build(Type =>"multipart/mixed",
@@ -426,7 +426,7 @@
'SEELED',
'DELIVERED']);
-Normally, an C<X-Mailer> header field is output which contains this
+Normally, an C<X-Mailer> header field is output which contains this
toolkit's name and version (plus this module's RCS version).
This will allow any bad MIME we generate to be traced back to us.
You can of course overwrite that header with your own:
@@ -448,72 +448,72 @@
Any field you want placed in the message header, taken from the
standard list of header fields (you don't need to worry about case):
- Bcc Encrypted Received Sender
- Cc From References Subject
- Comments Keywords Reply-To To
+ Bcc Encrypted Received Sender
+ Cc From References Subject
+ Comments Keywords Reply-To To
Content-* Message-ID Resent-* X-*
- Date MIME-Version Return-Path
+ Date MIME-Version Return-Path
Organization
-To give experienced users some veto power, these fields will be set
+To give experienced users some veto power, these fields will be set
I<after> the ones I set... so be careful: I<don't set any MIME fields>
(like C<Content-type>) unless you know what you're doing!
To specify a fieldname that's I<not> in the above list, even one that's
identical to an option below, just give it with a trailing C<":">,
-like C<"My-field:">. When in doubt, that I<always> signals a mail
+like C<"My-field:">. When in doubt, that I<always> signals a mail
field (and it sort of looks like one too).
=item Boundary
-I<Multipart entities only. Optional.>
-The boundary string. As per RFC-2046, it must consist only
+I<Multipart entities only. Optional.>
+The boundary string. As per RFC-1521, it must consist only
of the characters C<[0-9a-zA-Z'()+_,-./:=?]> and space (you'll be
warned, and your boundary will be ignored, if this is not the case).
-If you omit this, a random string will be chosen... which is probably
+If you omit this, a random string will be chosen... which is probably
safer.
=item Charset
-I<Optional.>
+I<Optional.>
The character set.
=item Data
-I<Single-part entities only. Optional.>
+I<Single-part entities only. Optional.>
An alternative to Path (q.v.): the actual data, either as a scalar
or an array reference (whose elements are joined together to make
-the actual scalar). The body is opened on the data using
+the actual scalar). The body is opened on the data using
MIME::Body::InCore.
=item Description
-I<Optional.>
-The text of the content-description.
+I<Optional.>
+The text of the content-description.
If you don't specify it, the field is not put in the header.
=item Disposition
-I<Optional.>
+I<Optional.>
The basic content-disposition (C<"attachment"> or C<"inline">).
If you don't specify it, it defaults to "inline" for backwards
compatibility. I<Thanks to Kurt Freytag for suggesting this feature.>
=item Encoding
-I<Optional.>
+I<Optional.>
The content-transfer-encoding.
If you don't specify it, a reasonable default is put in.
-You can also give the special value '-SUGGEST', to have it chosen for
+You can also give the special value '-SUGGEST', to have it chosen for
you in a heavy-duty fashion which scans the data itself.
=item Filename
-I<Single-part entities only. Optional.>
+I<Single-part entities only. Optional.>
The recommended filename. Overrides any name extracted from C<Path>.
The information is stored both the deprecated (content-type) and
-preferred (content-disposition) locations. If you explicitly want to
-I<avoid> a recommended filename (even when Path is used), supply this
+preferred (content-disposition) locations. If you explicitly want to
+I<avoid> a recommended filename (even when Path is used), supply this
as empty or undef.
=item Id
@@ -523,22 +523,22 @@
=item Path
-I<Single-part entities only. Optional.>
+I<Single-part entities only. Optional.>
The path to the file to attach. The body is opened on that file
using MIME::Body::File.
=item Top
-I<Optional.>
+I<Optional.>
Is this a top-level entity? If so, it must sport a MIME-Version.
The default is true. (NB: look at how C<attach()> uses it.)
=item Type
-I<Optional.>
-The basic content-type (C<"text/plain">, etc.).
-If you don't specify it, it defaults to C<"text/plain">
-as per RFC 2045. I<Do yourself a favor: put it in.>
+I<Optional.>
+The basic content-type (C<"text/plain">, etc.).
+If you don't specify it, it defaults to C<"text/plain">
+as per RFC-1521. I<Do yourself a favor: put it in.>
=back
@@ -569,16 +569,16 @@
my ($path_fname) = (($params{Path}||'') =~ m{([^/]+)\Z});
$filename = (exists($params{Filename}) ? $params{Filename} : $path_fname);
$filename = undef if (defined($filename) and $filename eq '');
-
+
### Type-check sanity:
if ($type =~ m{^(multipart|message)/}) {
- ($encoding =~ /^(|7bit|8bit|binary|-suggest)$/i)
+ ($encoding =~ /^(|7bit|8bit|binary|-suggest)$/i)
or croak "can't have encoding $encoding for message type $type!";
}
### Multipart or not? Do sanity check and fixup:
if ($is_multipart) { ### multipart...
-
+
### Get any supplied boundary, and check it:
if (defined($boundary = $params{Boundary})) { ### they gave us one...
if ($boundary eq '') {
@@ -590,7 +590,7 @@
$boundary = undef;
}
}
-
+
### If we have to roll our own boundary, do so:
defined($boundary) or $boundary = make_boundary();
}
@@ -602,7 +602,7 @@
elsif (defined($params{Data})) {
$self->bodyhandle(new MIME::Body::InCore $params{Data});
}
- else {
+ else {
die "can't build entity: no body, and not multipart\n";
}
@@ -626,7 +626,7 @@
$field->boundary($boundary) if defined($boundary);
$head->replace('Content-type', $field->stringify);
- ### Now that both body and content-type are available, we can suggest
+ ### Now that both body and content-type are available, we can suggest
### content-transfer-encoding (if desired);
if (!$encoding) {
$encoding = $self->suggest_encoding_lite;
@@ -634,7 +634,7 @@
elsif (lc($encoding) eq '-suggest') {
$encoding = $self->suggest_encoding;
}
-
+
### Add content-disposition field (if not multipart):
unless ($is_multipart) {
$field = new Mail::Field 'Content_disposition'; ### not a typo :-(
@@ -650,10 +650,10 @@
$head->replace('MIME-Version', '1.0') if $top;
### Add the X-Mailer field, if top level (use default value if not given):
- $top and $head->replace('X-Mailer',
+ $top and $head->replace('X-Mailer',
"MIME-tools ".(MIME::Tools->version).
- " (Entity " .($VERSION).")");
-
+ " (Entity " .($VERSION).")");
+
### Add remaining user-specified fields, if any:
while (@paramlist) {
my ($tag, $value) = (shift @paramlist, shift @paramlist);
@@ -671,7 +671,7 @@
$head->add($tag, $value);
}
}
-
+
### Done!
$self;
}
@@ -680,13 +680,13 @@
=item dup
-I<Instance method.>
+I<Instance method.>
Duplicate the entity. Does a deep, recursive copy, I<but beware:>
-external data in bodyhandles is I<not> copied to new files!
-Changing the data in one entity's data file, or purging that entity,
+external data in bodyhandles is I<not> copied to new files!
+Changing the data in one entity's data file, or purging that entity,
I<will> affect its duplicate. Entities with in-core data probably need
not worry.
-'
+
=cut
sub dup {
@@ -698,7 +698,7 @@
### Any simple inst vars:
foreach (keys %$self) {$dup->{$_} = $self->{$_} unless ref($self->{$_})};
-
+
### Bodyhandle:
$dup->bodyhandle($self->bodyhandle ? $self->bodyhandle->dup : undef);
@@ -737,18 +737,15 @@
=item body [VALUE]
I<Instance method.>
-Get the I<encoded> (transport-ready) body, as an array of lines.
-Returns an array reference. Each array entry is a newline-terminated
-line.
-
-This is a read-only data structure: changing its contents will have
-no effect. Its contents are identical to what is printed by
+Get the I<encoded> (transport-ready) body, as an array of lines.
+This is a read-only data structure: changing its contents will have
+no effect. Its contents are identical to what is printed by
L<print_body()|/print_body>.
Provided for compatibility with Mail::Internet, so that methods
-like C<smtpsend()> will work. Note however that if VALUE is given,
-a fatal exception is thrown, since you cannot use this method to
-I<set> the lines of the encoded message.
+like C<smtpsend()> will work. Note however that if VALUE is given,
+a fatal exception is thrown, since you cannot use this method to
+I<set> the lines of the encoded message.
If you want the raw (unencoded) body data, use the L<bodyhandle()|/bodyhandle>
method to get and use a MIME::Body. The content-type of the entity
@@ -758,20 +755,16 @@
=cut
sub body {
- my ($self, $value) = @_;
- if (@_ > 1) { ### setting body line(s)...
- croak "you cannot use body() to set the encoded contents\n";
- } else {
- my $output = '';
- my $fh = IO::File->new(\$output, '>:') or croak("Cannot open in-memory file: $!");
- $self->print_body($fh);
- close($fh);
- my @ary = split(/\n/, $output);
- # Each line needs the terminating newline
- @ary = map { "$_\n" } @ary;
-
- return \@ary;
- }
+ my ($self, $value) = @_;
+ if (@_ > 1) { ### setting body line(s)...
+ croak "you cannot use body() to set the encoded contents\n";
+ }
+ else { ### getting body lines...
+ my $lines = [];
+ my $lh = IO::Lines->new($lines);
+ $self->print_body($lh);
+ return $lines;
+ }
}
#------------------------------
@@ -784,10 +777,10 @@
B<Note that not all entities have bodies!>
An entity will have either a body or parts: not both.
-This method will I<only> return an object if this entity can
-have a body; otherwise, it will return undefined.
-Whether-or-not a given entity can have a body is determined by
-(1) its content type, and (2) whether-or-not the parser was told to
+This method will I<only> return an object if this entity can
+have a body; otherwise, it will return undefined.
+Whether-or-not a given entity can have a body is determined by
+(1) its content type, and (2) whether-or-not the parser was told to
extract nested messages:
Type: | Extract nested? | bodyhandle() | parts()
@@ -820,7 +813,7 @@
I<Instance method.>
Set/get the I<effective> MIME type of this entity. This is I<usually>
-identical to the actual (or defaulted) MIME type, but in some cases
+identical to the actual (or defaulted) MIME type, but in some cases
it differs. For example, from RFC-2045:
Any entity with an unrecognized Content-Transfer-Encoding must be
@@ -833,10 +826,10 @@
bytes -- in other words, an "application/octet-stream".
Such an entity, if parsed, would have its effective_type() set to
-C<"application/octet_stream">, although the mime_type() and the contents
+C<"application/octet_stream">, although the mime_type() and the contents
of the header would remain the same.
-If there is no effective type, the method just returns what
+If there is no effective type, the method just returns what
mime_type() would.
B<Warning:> the effective type is "sticky"; once set, that effective_type()
@@ -861,7 +854,7 @@
Returns a reference to the array of lines, or undef if no epilogue exists.
If there is a epilogue, it is output when printing this entity; otherwise,
-a default epilogue is used. Setting the epilogue to undef (not []!) causes
+a default epilogue is used. Setting the epilogue to undef (not []!) causes
it to fallback to the default.
=cut
@@ -877,17 +870,17 @@
=item head [VALUE]
I<Instance method.>
-Get/set the head.
+Get/set the head.
If there is no VALUE given, returns the current head. If none
exists, an empty instance of MIME::Head is created, set, and returned.
-B<Note:> This is a patch over a problem in Mail::Internet, which doesn't
+B<Note:> This is a patch over a problem in Mail::Internet, which doesn't
provide a method for setting the head to some given object.
=cut
-sub head {
+sub head {
my ($self, $value) = @_;
(@_ > 1) and $self->{'mail_inet_head'} = $value;
$self->{'mail_inet_head'} ||= new MIME::Head; ### KLUDGE!
@@ -903,7 +896,7 @@
if it was determined to be false, and true otherwise.
Note that this says nothing about whether or not parts were extracted.
-NOTE: we switched to effective_type so that multiparts with
+NOTE: we switched to effective_type so that multiparts with
bad or missing boundaries could be coerced to an effective type
of C<application/x-unparseable-multipart>.
@@ -922,8 +915,8 @@
=item mime_type
I<Instance method.>
-A purely-for-convenience method. This simply relays the request to the
-associated MIME::Head object.
+A purely-for-convenience method. This simply relays the request to the
+associated MIME::Head object.
If there is no head, returns undef in a scalar context and
the empty array in a list context.
@@ -943,8 +936,8 @@
=item open READWRITE
I<Instance method.>
-A purely-for-convenience method. This simply relays the request to the
-associated MIME::Body object (see MIME::Body::open()).
+A purely-for-convenience method. This simply relays the request to the
+associated MIME::Body object (see MIME::Body::open()).
READWRITE is either 'r' (open for read) or 'w' (open for write).
If there is no body, returns false.
@@ -968,31 +961,31 @@
Return the MIME::Entity objects which are the sub parts of this
entity (if any).
-I<If no argument is given,> returns the array of all sub parts,
-returning the empty array if there are none (e.g., if this is a single
-part message, or a degenerate multipart). In a scalar context, this
+I<If no argument is given,> returns the array of all sub parts,
+returning the empty array if there are none (e.g., if this is a single
+part message, or a degenerate multipart). In a scalar context, this
returns you the number of parts.
-I<If an integer INDEX is given,> return the INDEXed part,
+I<If an integer INDEX is given,> return the INDEXed part,
or undef if it doesn't exist.
-I<If an ARRAYREF to an array of parts is given,> then this method I<sets>
+I<If an ARRAYREF to an array of parts is given,> then this method I<sets>
the parts to a copy of that array, and returns the parts. This can
be used to delete parts, as follows:
### Delete some parts of a multipart message:
$msg->parts([ grep { keep_part($_) } $msg->parts ]);
+
-
-B<Note:> for multipart messages, the preamble and epilogue are I<not>
-considered parts. If you need them, use the C<preamble()> and C<epilogue()>
+B<Note:> for multipart messages, the preamble and epilogue are I<not>
+considered parts. If you need them, use the C<preamble()> and C<epilogue()>
methods.
B<Note:> there are ways of parsing with a MIME::Parser which cause
certain message parts (such as those of type C<message/rfc822>)
to be "reparsed" into pseudo-multipart entities. You should read the
documentation for those options carefully: it I<is> possible for
-a diddled entity to not be multipart, but still have parts attached to it!
+a diddled entity to not be multipart, but still have parts attached to it!
See L</bodyhandle> for a discussion of parts vs. bodies.
@@ -1010,7 +1003,7 @@
I<Instance method.>
Return the list of all MIME::Entity objects included in the entity,
-starting with the entity itself, in depth-first-search order.
+starting with the entity itself, in depth-first-search order.
If the entity has no parts, it alone will be returned.
I<Thanks to Xavier Armengou for suggesting this method.>
@@ -1032,7 +1025,7 @@
(e.g., if this is a single-part entity).
If there is a preamble, it is output when printing this entity; otherwise,
-a default preamble is used. Setting the preamble to undef (not []!) causes
+a default preamble is used. Setting the preamble to undef (not []!) causes
it to fallback to the default.
=cut
@@ -1078,7 +1071,7 @@
To: you
Content-type: text/plain
Content-length: 12
-
+
Hello there!
Becomes something like this:
@@ -1086,15 +1079,15 @@
From: me
To: you
Content-type: multipart/mixed; boundary="----abc----"
-
+
------abc----
Content-type: text/plain
Content-length: 12
-
+
Hello there!
------abc------
-The actual type of the new top-level multipart will be "multipart/SUBTYPE"
+The actual type of the new top-level multipart will be "multipart/SUBTYPE"
(default SUBTYPE is "mixed").
Returns 'DONE' if we really did inflate a singlepart to a multipart.
@@ -1102,8 +1095,8 @@
and Force was not chosen.
If OPTSHASH contains Force=>1, then we I<always> bump the top-level's
-content and content-headers down to a subpart of this entity, even if
-this entity is already a multipart. This is apparently of use to
+content and content-headers down to a subpart of this entity, even if
+this entity is already a multipart. This is apparently of use to
people who are tweaking messages after parsing them.
=cut
@@ -1115,13 +1108,13 @@
my $force = $opts{Force};
### Trap for simple case: already a multipart?
- return 'ALREADY' if ($self->is_multipart and !$force);
+ return 'ALREADY' if ($self->is_multipart and !$force);
### Rip out our guts, and spew them into our future part:
my $part = bless {%$self}, ref($self); ### part is a shallow copy
%$self = (); ### lobotomize ourselves!
$self->head($part->head->dup); ### dup the header
-
+
### Remove content headers from top-level, and set it up as a multipart:
foreach $tag (grep {/^content-/i} $self->head->tags) {
$self->head->delete($tag);
@@ -1135,7 +1128,7 @@
}
### Add the [sole] part:
- $self->{ME_Parts} = [];
+ $self->{ME_Parts} = [];
$self->add_part($part);
'DONE';
}
@@ -1151,7 +1144,7 @@
into singleparts.
Returns 'DONE' if we really did collapse a multipart to a singlepart.
-Returns 'ALREADY' (and does nothing) if entity is already a singlepart.
+Returns 'ALREADY' (and does nothing) if entity is already a singlepart.
Returns '0' (and does nothing) if it can't be made into a singlepart.
=cut
@@ -1172,7 +1165,7 @@
foreach $tag (grep {/^content-/i} $self->head->tags) {
$self->head->delete($tag);
}
-
+
### Populate ourselves with any content info from the part:
foreach $tag (grep {/^content-/i} $part->head->tags) {
foreach ($part->head->get($tag)) { $self->head->add($tag, $_) }
@@ -1197,7 +1190,7 @@
=item purge
I<Instance method.>
-Recursively purge (e.g., unlink) all external (e.g., on-disk) body parts
+Recursively purge (e.g., unlink) all external (e.g., on-disk) body parts
in this message. See MIME::Body::purge() for details.
B<Note:> this does I<not> delete the directories that those body parts
@@ -1206,7 +1199,7 @@
directories while others are not, and it's impossible for this class
to know what directories are safe to remove. Only your application
program truly knows that.
-
+
B<If you really want to "clean everything up",> one good way is to
use C<MIME::Parser::file_under()>, and then do this before parsing
your next message:
@@ -1254,21 +1247,21 @@
=item remove_sig [NLINES]
I<Instance method, override.>
-Attempts to remove a user's signature from the body of a message.
+Attempts to remove a user's signature from the body of a message.
-It does this by looking for a line matching C</^-- $/> within the last
-C<NLINES> of the message. If found then that line and all lines after
-it will be removed. If C<NLINES> is not given, a default value of 10
+It does this by looking for a line matching C</^-- $/> within the last
+C<NLINES> of the message. If found then that line and all lines after
+it will be removed. If C<NLINES> is not given, a default value of 10
will be used. This would be of most use in auto-reply scripts.
For MIME entity, this method is reasonably cautious: it will only
attempt to un-sign a message with a content-type of C<text/*>.
-If you send remove_sig() to a multipart entity, it will relay it to
+If you send remove_sig() to a multipart entity, it will relay it to
the first part (the others usually being the "attachments").
B<Warning:> currently slurps the whole message-part into core as an
-array of lines, so you probably don't want to use this on extremely
+array of lines, so you probably don't want to use this on extremely
long messages.
Returns truth on success, false on error.
@@ -1285,7 +1278,7 @@
### Refuse non-textual unless forced:
textual_type($self->head->mime_type)
or return error "I won't un-sign a non-text message unless I'm forced";
-
+
### Get body data, as an array of newline-terminated lines:
$self->bodyhandle or return undef;
my @body = $self->bodyhandle->as_lines;
@@ -1299,7 +1292,7 @@
$io->close;
### Done!
- 1;
+ 1;
}
#------------------------------
@@ -1315,13 +1308,13 @@
Instead of appending the text, add it to the message as an attachment.
The disposition will be C<inline>, and the description will indicate
-that it is a signature. The default behavior is to append the signature
+that it is a signature. The default behavior is to append the signature
to the text of the message (or the text of its first part if multipart).
I<MIME-specific; new in this subclass.>
=item File
-Use the contents of this file as the signature.
+Use the contents of this file as the signature.
Fatal error if it can't be read.
I<As per superclass method.>
@@ -1351,11 +1344,11 @@
attempt to sign a message with a content-type of C<text/*>, unless
C<Force> is specified.
-If you send this message to a multipart entity, it will relay it to
+If you send this message to a multipart entity, it will relay it to
the first part (the others usually being the "attachments").
B<Warning:> currently slurps the whole message-part into core as an
-array of lines, so you probably don't want to use this on extremely
+array of lines, so you probably don't want to use this on extremely
long messages.
Returns true on success, false otherwise.
@@ -1378,9 +1371,9 @@
$sig = (ref($sig) ? join('', @$sig) : $sig);
}
elsif ($params{File}) { ### file contents
- my $fh = IO::File->new( $params{File} ) or croak "can't open $params{File}: $!";
- $sig = join('', $fh->getlines);
- $fh->close or croak "can't close $params{File}: $!";
+ CORE::open SIG, $params{File} or croak "can't open $params{File}: $!";
+ $sig = join('', SIG->getlines);
+ close SIG or croak "can't close $params{File}: $!";
}
else {
croak "no signature given!";
@@ -1403,7 +1396,7 @@
### Get body data, as an array of newline-terminated lines:
$self->bodyhandle or return undef;
my @body = $self->bodyhandle->as_lines;
-
+
### Nuke any existing sig?
if (!defined($params{Remove}) || ($params{Remove} > 0)) {
_do_remove_sig(\@body, $params{Remove});
@@ -1434,9 +1427,9 @@
Major type: 7bit ok? Suggested encoding:
-----------------------------------------------------------
text yes 7bit
- text no quoted-printable
+ text no quoted-printable
message yes 7bit
- message no binary
+ message no binary
multipart * binary (in case some parts are bad)
image, etc... * base64
@@ -1457,12 +1450,12 @@
while (defined($_ = $IO->getline)) {
last if ($unclean = ((length($_) > 999) or /[\200-\377]/));
}
-
+
### Return '7bit' if clean; try and encode if not...
### Note that encodings are not permitted for messages!
- return ($unclean
+ return ($unclean
? (($type eq 'message') ? 'binary' : 'quoted-printable')
- : '7bit');
+ : '7bit');
}
}
else {
@@ -1482,7 +1475,7 @@
I<Instance method.>
This method does a variety of activities which ensure that
-the MIME headers of an entity "tree" are in-synch with the body parts
+the MIME headers of an entity "tree" are in-synch with the body parts
they describe. It can be as expensive an operation as printing
if it involves pre-encoding the body parts; however, the aim is to
produce fairly clean MIME. B<You will usually only need to invoke
@@ -1500,9 +1493,9 @@
you are preparing output destined for HTTP, you may. The value of
this option dictates what will be done:
-B<COMPUTE> means to set a C<Content-Length> field for every non-multipart
-part in the entity, and to blank that field out for every multipart
-part in the entity.
+B<COMPUTE> means to set a C<Content-Length> field for every non-multipart
+part in the entity, and to blank that field out for every multipart
+part in the entity.
B<ERASE> means that C<Content-Length> fields will all
be blanked out. This is fast, painless, and safe.
@@ -1529,22 +1522,22 @@
=cut
sub sync_headers {
- my $self = shift;
+ my $self = shift;
my $opts = ((int(@_) % 2 == 0) ? {@_} : shift);
my $ENCBODY; ### keep it around until done!
### Get options:
my $o_nonstandard = ($opts->{Nonstandard} || 0);
my $o_length = ($opts->{Length} || 0);
-
+
### Get head:
my $head = $self->head;
-
+
### What to do with "nonstandard" MIME fields?
if ($o_nonstandard eq 'ERASE') { ### Erase them...
my $tag;
foreach $tag ($head->tags()) {
- if (($tag =~ /\AContent-/i) &&
+ if (($tag =~ /\AContent-/i) &&
($tag !~ /\AContent-$StandardFields\Z/io)) {
$head->delete($tag);
}
@@ -1566,14 +1559,14 @@
$ENCBODY = tmpopen() || die "can't open tmpfile";
$self->print_body($ENCBODY); ### write encoded to tmpfile
}
-
+
### Analyse it:
$ENCBODY->seek(0,2); ### fast-forward
$content_length = $ENCBODY->tell; ### get encoded length
- $ENCBODY->seek(0,0); ### rewind
-
- ### Remember:
- $self->head->replace('Content-length', $content_length);
+ $ENCBODY->seek(0,0); ### rewind
+
+ ### Remember:
+ $self->head->replace('Content-length', $content_length);
}
}
elsif ($o_length eq 'ERASE') { ### Erase the content-length...
@@ -1582,7 +1575,7 @@
### Done with everything for us!
undef($ENCBODY);
-
+
### Recurse:
my $part;
foreach $part ($self->parts) { $part->sync_headers($opts) or return undef }
@@ -1613,7 +1606,7 @@
#==============================
-=head2 Output
+=head2 Output
=over 4
@@ -1625,7 +1618,7 @@
I<Instance method.>
Dump the skeleton of the entity to the given FILEHANDLE, or
-to the currently-selected one if none given.
+to the currently-selected one if none given.
Each entity is output with an appropriate indentation level,
the following selection of attributes:
@@ -1683,27 +1676,27 @@
I<Instance method, override.>
Print the entity to the given OUTSTREAM, or to the currently-selected
-filehandle if none given. OUTSTREAM can be a filehandle, or any object
-that reponds to a print() message.
+filehandle if none given. OUTSTREAM can be a filehandle, or any object
+that reponds to a print() message.
-The entity is output as a valid MIME stream! This means that the
-header is always output first, and the body data (if any) will be
+The entity is output as a valid MIME stream! This means that the
+header is always output first, and the body data (if any) will be
encoded if the header says that it should be.
For example, your output may look like this:
Subject: Greetings
Content-transfer-encoding: base64
-
+
SGkgdGhlcmUhCkJ5ZSB0aGVyZSEK
-I<If this entity has MIME type "multipart/*",>
+I<If this entity has MIME type "multipart/*",>
the preamble, parts, and epilogue are all output with appropriate
-boundaries separating each.
+boundaries separating each.
Any bodyhandle is ignored:
Content-type: multipart/mixed; boundary="*----*"
Content-transfer-encoding: 7bit
-
+
[Preamble]
--*----*
[Entity: Part 0]
@@ -1713,30 +1706,30 @@
[Epilogue]
I<If this entity has a single-part MIME type with no attached parts,>
-then we're looking at a normal singlepart entity: the body is output
-according to the encoding specified by the header.
+then we're looking at a normal singlepart entity: the body is output
+according to the encoding specified by the header.
If no body exists, a warning is output and the body is treated as empty:
Content-type: image/gif
Content-transfer-encoding: base64
-
+
[Encoded body]
-I<If this entity has a single-part MIME type but it also has parts,>
+I<If this entity has a single-part MIME type but it also has parts,>
then we're probably looking at a "re-parsed" singlepart, usually one
-of type C<message/*> (you can get entities like this if you set the
+of type C<message/*> (you can get entities like this if you set the
C<parse_nested_messages(NEST)> option on the parser to true).
In this case, the parts are output with single blank lines separating each,
and any bodyhandle is ignored:
Content-type: message/rfc822
Content-transfer-encoding: 7bit
-
+
[Entity: Part 0]
-
+
[Entity: Part 1]
-In all cases, when outputting a "part" of the entity, this method
+In all cases, when outputting a "part" of the entity, this method
is invoked recursively.
B<Note:> the output is very likely I<not> going to be identical
@@ -1750,7 +1743,8 @@
my ($self, $out) = @_;
$out = select if @_ < 2;
$out = Symbol::qualify($out,scalar(caller)) unless ref($out);
-
+ $out = wraphandle($out); ### get a printable output
+
$self->print_header($out); ### the header
$out->print("\n");
$self->print_body($out); ### the "stuff after the header"
@@ -1761,11 +1755,11 @@
=item print_body [OUTSTREAM]
I<Instance method, override.>
-Print the body of the entity to the given OUTSTREAM, or to the
-currently-selected filehandle if none given. OUTSTREAM can be a
-filehandle, or any object that reponds to a print() message.
+Print the body of the entity to the given OUTSTREAM, or to the
+currently-selected filehandle if none given. OUTSTREAM can be a
+filehandle, or any object that reponds to a print() message.
-The body is output for inclusion in a valid MIME stream; this means
+The body is output for inclusion in a valid MIME stream; this means
that the body data will be encoded if the header says that it should be.
B<Note:> by "body", we mean "the stuff following the header".
@@ -1780,23 +1774,23 @@
$ent->bodyhandle->print($outstream);
-which uses read() calls to extract the information, and thus will
+which uses read() calls to extract the information, and thus will
work with both text and binary bodies.
B<Warning:> Please supply an OUTSTREAM. This override method differs
-from Mail::Internet's behavior, which outputs to the STDOUT if no
+from Mail::Internet's behavior, which outputs to the STDOUT if no
filehandle is given: this may lead to confusion.
=cut
sub print_body {
my ($self, $out) = @_;
- $out ||= select;
+ $out = wraphandle($out || select); ### get a printable output
my ($type) = split '/', lc($self->mime_type); ### handle by MIME type
### Multipart...
if ($type eq 'multipart') {
- my $boundary = $self->head->multipart_boundary;
+ my $boundary = $self->head->multipart_boundary;
### Preamble:
my $preamble = join('', @{ $self->preamble || $DefPreamble });
@@ -1832,7 +1826,7 @@
}
### Singlepart type, or no parts: output body...
- else {
+ else {
$self->bodyhandle ? $self->print_bodyhandle($out)
: whine "missing body; treated as empty";
}
@@ -1846,11 +1840,11 @@
# Instance method, unpublicized. Print just the bodyhandle, *encoded*.
#
# WARNING: $self->print_bodyhandle() != $self->bodyhandle->print()!
-# The former encodes, and the latter does not!
+# The former encodes, and the latter does not!
#
sub print_bodyhandle {
my ($self, $out) = @_;
- $out ||= select;
+ $out = wraphandle($out || select); ### get a printable output
my $IO = $self->open("r") || die "open body: $!";
if ( $self->bodyhandle->is_encoded ) {
@@ -1875,7 +1869,7 @@
=item print_header [OUTSTREAM]
I<Instance method, inherited.>
-Output the header to the given OUTSTREAM. You really should supply
+Output the header to the given OUTSTREAM. You really should supply
the OUTSTREAM.
=cut
@@ -1887,19 +1881,16 @@
=item stringify
I<Instance method.>
-Return the entity as a string, exactly as C<print> would print it.
-The body will be encoded as necessary, and will contain any subparts.
+Return the entity as a string, exactly as C<print> would print it.
+The body will be encoded as necessary, and will contain any subparts.
You can also use C<as_string()>.
=cut
sub stringify {
- my ($self) = @_;
- my $output = '';
- my $fh = IO::File->new( \$output, '>:' ) or croak("Cannot open in-memory file: $!");
- $self->print($fh);
- $fh->close;
- return $output;
+ my @arr = ();
+ shift->print(new IO::ScalarArray \@arr);
+ join("", @arr);
}
sub as_string { shift->stringify }; ### silent BC
@@ -1909,7 +1900,7 @@
=item stringify_body
I<Instance method.>
-Return the I<encoded> message body as a string, exactly as C<print_body>
+Return the I<encoded> message body as a string, exactly as C<print_body>
would print it. You can also use C<body_as_string()>.
If you want the I<unencoded> body, and you are dealing with a
@@ -1925,19 +1916,28 @@
=cut
sub stringify_body {
- my ($self) = @_;
- my $output = '';
- my $fh = IO::File->new( \$output, '>:' ) or croak("Cannot open in-memory file: $!");
- $self->print_body($fh);
- $fh->close;
- return $output;
+ my @arr = ();
+ shift->print_body(new IO::ScalarArray \@arr);
+ join("", @arr);
}
-
sub body_as_string { shift->stringify_body }
#------------------------------
+#
+# stringify_bodyhandle
+#
+# Instance method, unpublicized. Stringify just the bodyhandle.
+
+sub stringify_bodyhandle {
+ my @arr = ();
+ shift->print_bodyhandle(new IO::ScalarArray \@arr);
+ join("", @arr);
+}
+sub bodyhandle_as_string { shift->stringify_bodyhandle }
+
+#------------------------------
-=item stringify_header
+=item stringify_header
I<Instance method.>
Return the header as a string, exactly as C<print_header> would print it.
@@ -1951,9 +1951,10 @@
sub header_as_string { shift->stringify_header }
-1;
-__END__
+__END__
+1;
+
#------------------------------
=back
@@ -1974,7 +1975,7 @@
=item *
A I<bodyhandle>, which is a reference to a MIME::Body object
-containing the decoded body data. This is only defined if
+containing the decoded body data. This is only defined if
the message is a "singlepart" type:
application/*
@@ -1985,8 +1986,8 @@
=item *
-An array of I<parts>, where each part is a MIME::Entity object.
-The number of parts will only be nonzero if the content-type
+An array of I<parts>, where each part is a MIME::Entity object.
+The number of parts will only be nonzero if the content-type
is I<not> one of the "singlepart" types:
message/* (should have exactly one part)
@@ -2000,7 +2001,7 @@
=head2 The "two-body problem"
MIME::Entity and Mail::Internet see message bodies differently,
-and this can cause confusion and some inconvenience. Sadly, I can't
+and this can cause confusion and some inconvenience. Sadly, I can't
change the behavior of MIME::Entity without breaking lots of code already
out there. But let's open up the floor for a few questions...
@@ -2012,14 +2013,14 @@
this means a stream of newline-terminated lines.
An B<entity> is the representation of a message as an object.
-This means that you get a "message" when you print an "entity"
+This means that you get a "message" when you print an "entity"
I<to> a filehandle, and you get an "entity" when you parse a message
I<from> a filehandle.
=item What is a message body?
-B<Mail::Internet:>
+B<Mail::Internet:>
The portion of the printed message after the header.
B<MIME::Entity:>
@@ -2028,60 +2029,69 @@
=item How is a message body stored in an entity?
-B<Mail::Internet:>
+B<Mail::Internet:>
As an array of lines.
-B<MIME::Entity:>
+B<MIME::Entity:>
It depends on the content-type of the message.
For "container" types (C<multipart/*>, C<message/*>), we store the
contained entities as an array of "parts", accessed via the C<parts()>
method, where each part is a complete MIME::Entity.
For "singlepart" types (C<text/*>, C<image/*>, etc.), the unencoded
-body data is referenced via a MIME::Body object, accessed via
+body data is referenced via a MIME::Body object, accessed via
the C<bodyhandle()> method:
bodyhandle() parts()
Content-type: returns: returns:
------------------------------------------------------------
application/* MIME::Body empty
- audio/* MIME::Body empty
- image/* MIME::Body empty
+ audio/* MIME::Body empty
+ image/* MIME::Body empty
message/* undef MIME::Entity list (usually 1)
multipart/* undef MIME::Entity list (usually >0)
- text/* MIME::Body empty
- video/* MIME::Body empty
- x-*/* MIME::Body empty
+ text/* MIME::Body empty
+ video/* MIME::Body empty
+ x-*/* MIME::Body empty
-As a special case, C<message/*> is currently ambiguous: depending
+As a special case, C<message/*> is currently ambiguous: depending
on the parser, a C<message/*> might be treated as a singlepart,
-with a MIME::Body and no parts. Use bodyhandle() as the final
+with a MIME::Body and no parts. Use bodyhandle() as the final
arbiter.
=item What does the body() method return?
-B<Mail::Internet:>
+B<Mail::Internet:>
As an array of lines, ready for sending.
-B<MIME::Entity:>
+B<MIME::Entity:>
As an array of lines, ready for sending.
+
+=item If an entity has a body, does it have a soul as well?
+
+The soul does not exist in a corporeal sense, the way the body does;
+it is not a solid [Perl] object. Rather, it is a virtual object
+which is only visible when you print() an entity to a file... in other
+words, the "soul" it is all that is left after the body is DESTROY'ed.
+
+
=item What's the best way to get at the body data?
-B<Mail::Internet:>
+B<Mail::Internet:>
Use the body() method.
-B<MIME::Entity:>
-Depends on what you want... the I<encoded> data (as it is
+B<MIME::Entity:>
+Depends on what you want... the I<encoded> data (as it is
transported), or the I<unencoded> data? Keep reading...
=item How do I get the "encoded" body data?
-B<Mail::Internet:>
+B<Mail::Internet:>
Use the body() method.
-B<MIME::Entity:>
+B<MIME::Entity:>
Use the body() method. You can also use:
$entity->print_body()
@@ -2090,14 +2100,14 @@
=item How do I get the "unencoded" body data?
-B<Mail::Internet:>
+B<Mail::Internet:>
Use the body() method.
-B<MIME::Entity:>
+B<MIME::Entity:>
Use the I<bodyhandle()> method!
-If bodyhandle() method returns true, then that value is a
-L<MIME::Body|MIME::Body> which can be used to access the data via
-its open() method. If bodyhandle() method returns an undefined value,
+If bodyhandle() method returns true, then that value is a
+L<MIME::Body|MIME::Body> which can be used to access the data via
+its open() method. If bodyhandle() method returns an undefined value,
then the entity is probably a "container" that has no real body data of
its own (e.g., a "multipart" message): in this case, you should access
the components via the parts() method. Like this:
@@ -2125,45 +2135,45 @@
=item What does the body() method return?
-B<Mail::Internet:>
+B<Mail::Internet:>
The transport-encoded message body, as an array of lines.
-B<MIME::Entity:>
+B<MIME::Entity:>
The transport-encoded message body, as an array of lines.
=item What does print_body() print?
-B<Mail::Internet:>
+B<Mail::Internet:>
Exactly what body() would return to you.
-B<MIME::Entity:>
+B<MIME::Entity:>
Exactly what body() would return to you.
=item Say I have an entity which might be either singlepart or multipart.
How do I print out just "the stuff after the header"?
-B<Mail::Internet:>
+B<Mail::Internet:>
Use print_body().
-B<MIME::Entity:>
-Use print_body().
+B<MIME::Entity:>
+Use print_body().
=item Why is MIME::Entity so different from Mail::Internet?
Because MIME streams are expected to have non-textual data...
-possibly, quite a lot of it, such as a tar file.
+possibly, quite a lot of it, such as a tar file.
-Because MIME messages can consist of multiple parts, which are most-easily
+Because MIME messages can consist of multiple parts, which are most-easily
manipulated as MIME::Entity objects themselves.
Because in the simpler world of Mail::Internet, the data of a message
and its printed representation are I<identical>... and in the MIME
world, they're not.
-Because parsing multipart bodies on-the-fly, or formatting multipart
+Because parsing multipart bodies on-the-fly, or formatting multipart
bodies for output, is a non-trivial task.
@@ -2171,8 +2181,8 @@
Not easily; their implementations are necessarily quite different.
Mail::Internet is a simple, efficient way of dealing with a "black box"
-mail message... one whose internal data you don't care much about.
-MIME::Entity, in contrast, cares I<very much> about the message contents:
+mail message... one whose internal data you don't care much about.
+MIME::Entity, in contrast, cares I<very much> about the message contents:
that's its job!
=back
@@ -2189,30 +2199,30 @@
the first encapsulation boundary, and the I<"epilogue"> is the portion
that follows the last encapsulation boundary.
-According to RFC 2046:
+According to RFC-1521:
- There appears to be room for additional information prior
- to the first encapsulation boundary and following the final
+ There appears to be room for additional information prior
+ to the first encapsulation boundary and following the final
boundary. These areas should generally be left blank, and
- implementations must ignore anything that appears before the
+ implementations must ignore anything that appears before the
first boundary or after the last one.
- NOTE: These "preamble" and "epilogue" areas are generally
- not used because of the lack of proper typing of these parts
- and the lack of clear semantics for handling these areas at
- gateways, particularly X.400 gateways. However, rather than
- leaving the preamble area blank, many MIME implementations
- have found this to be a convenient place to insert an
- explanatory note for recipients who read the message with
- pre-MIME software, since such notes will be ignored by
+ NOTE: These "preamble" and "epilogue" areas are generally
+ not used because of the lack of proper typing of these parts
+ and the lack of clear semantics for handling these areas at
+ gateways, particularly X.400 gateways. However, rather than
+ leaving the preamble area blank, many MIME implementations
+ have found this to be a convenient place to insert an
+ explanatory note for recipients who read the message with
+ pre-MIME software, since such notes will be ignored by
MIME-compliant software.
-In the world of standards-and-practices, that's the standard.
-Now for the practice:
+In the world of standards-and-practices, that's the standard.
+Now for the practice:
I<Some "MIME" mailers may incorrectly put a "part" in the preamble>.
Since we have to parse over the stuff I<anyway>, in the future I
-I<may> allow the parser option of creating special MIME::Entity objects
+I<may> allow the parser option of creating special MIME::Entity objects
for the preamble and epilogue, with bogus MIME::Head objects.
For now, though, we're MIME-compliant, so I probably won't change
@@ -2226,7 +2236,15 @@
Eryq (F<eryq@zeegee.com>), ZeeGee Software Inc (F<http://www.zeegee.com>).
David F. Skoll (dfs@roaringpenguin.com) http://www.roaringpenguin.com
-All rights reserved. This program is free software; you can redistribute
+All rights reserved. This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
+
+=head1 VERSION
+
+$Revision: 1.18 $ $Date: 2006/03/17 21:15:49 $
+
=cut
+
+#------------------------------
+1;
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Field/ConTraEnc.pm
^
|
@@ -44,7 +44,7 @@
@ISA = qw(MIME::Field::ParamVal);
# The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.426";
+$VERSION = "5.420";
# Install it:
bless([])->register('Content-transfer-encoding');
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Field/ContDisp.pm
^
|
@@ -45,7 +45,7 @@
@ISA = qw(MIME::Field::ParamVal);
# The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.426";
+$VERSION = "5.420";
# Install it:
bless([])->register('Content-disposition');
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Field/ContType.pm
^
|
@@ -24,7 +24,7 @@
'text/HTML; charset="US-ASCII"');
# Get the MIME type, like 'text/plain' or 'x-foobar'.
- # Returns 'text/plain' as default, as per RFC 2045:
+ # Returns 'text/plain' as default, as per RFC-1521:
my ($type, $subtype) = split('/', $field->type);
# Get generic information:
@@ -63,17 +63,27 @@
@ISA = qw(MIME::Field::ParamVal);
# The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.426";
+$VERSION = "5.420";
# Install it:
bless([])->register('Content-type');
+# Pattern to match an RFC-1521 token.
+# NOTE: should just use the REs in MIME::Field::ParamVal!
+#
+# token = 1*<any (ASCII) CHAR except SPACE, CTLs, or tspecials>
+#
+my $TSPECIAL = '()<>@,;:\</[]?="';
+my $TOKEN = '[^ \x00-\x1f\x80-\xff' . "\Q$TSPECIAL\E" . ']+';
+
+
+
#------------------------------
#
# Basic access/storage methods...
#
sub charset {
- lc(shift->paramstr('charset', @_)) || 'us-ascii'; # RFC 2045
+ lc(shift->paramstr('charset', @_)) || 'us-ascii'; # RFC-1521
}
sub id {
shift->paramstr('id', @_);
@@ -93,14 +103,14 @@
=item boundary
-Return the boundary field. The boundary is returned exactly
-as given in the C<Content-type:> field; that is, the leading
+Return the boundary field. The boundary is returned exactly
+as given in the C<Content-type:> field; that is, the leading
double-hyphen (C<-->) is I<not> prepended.
-(Well, I<almost> exactly... from RFC 2046:
+(Well, I<almost> exactly... from RFC-1521:
- (If a boundary appears to end with white space, the white space
- must be presumed to have been added by a gateway, and must be deleted.)
+ (If a boundary appears to end with white space, the white space
+ must be presumed to have been added by a gateway, and must be deleted.)
so we oblige and remove any trailing spaces.)
@@ -111,9 +121,9 @@
=cut
sub boundary {
- my $value = shift->param('boundary', @_);
+ my $value = shift->param('boundary', @_);
defined($value) || return '';
- $value =~ s/\s+$//; # kill trailing white, per RFC 2046
+ $value =~ s/\s+$//; # kill trailing white, per RFC-1521
$value;
}
@@ -149,9 +159,9 @@
($type, $subtype) = split('/', $head->mime_type);
If the content-type information is missing, it defaults to C<"text/plain">,
-as per RFC 2045:
+as per RFC-1521:
- Default RFC 2822 messages are typed by this protocol as plain text in
+ Default RFC-822 messages are typed by this protocol as plain text in
the US-ASCII character set, which can be explicitly specified as
"Content-type: text/plain; charset=us-ascii". If no Content-Type is
specified, this default is assumed.
@@ -163,7 +173,7 @@
=cut
sub type {
- lc(shift->paramstr('_', @_)) || 'text/plain'; # RFC 2045
+ lc(shift->paramstr('_', @_)) || 'text/plain'; # RFC-1521
}
#------------------------------
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Field/ParamVal.pm
^
|
@@ -80,7 +80,7 @@
#------------------------------
# The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.426";
+$VERSION = "5.420";
#------------------------------
@@ -95,7 +95,7 @@
# Pattern to match the first value on the line:
my $FIRST = '[^\s\;\x00-\x1f\x80-\xff]+';
-# Pattern to match an RFC 2045 token:
+# Pattern to match an RFC-1521 token:
#
# token = 1*<any (ASCII) CHAR except SPACE, CTLs, or tspecials>
#
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Head.pm
^
|
@@ -95,10 +95,9 @@
=head1 DESCRIPTION
-A class for parsing in and manipulating RFC-822 message headers, with
-some methods geared towards standard (and not so standard) MIME fields
-as specified in the various I<Multipurpose Internet Mail Extensions>
-RFCs (starting with RFC 2045)
+A class for parsing in and manipulating RFC-822 message headers, with some
+methods geared towards standard (and not so standard) MIME fields as
+specified in RFC-1521, I<Multipurpose Internet Mail Extensions>.
=head1 PUBLIC INTERFACE
@@ -114,7 +113,7 @@
use vars qw($VERSION @ISA @EXPORT_OK);
### System modules:
-use IO::File;
+use IO::Wrap;
### Other modules:
use Mail::Header 1.09 ();
@@ -138,7 +137,7 @@
#------------------------------
### The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.426";
+$VERSION = "5.420";
### Sanity (we put this test after our own version, for CPAN::):
use Mail::Header 1.06 ();
@@ -204,10 +203,10 @@
my $class = ref($self) ? ref($self) : $self;
### Parse:
- my $fh = IO::File->new($file, '<') or return error("open $file: $!");
- $fh->binmode() or return error("binmode $file: $!"); # we expect to have \r\n at line ends, and want to keep 'em.
- $self = $class->new($fh, @opts); ### now, $self is instance or undef
- $fh->close or return error("close $file: $!");
+ open(HDR, $file) or return error("open $file: $!");
+ binmode(HDR) or return error("binmode $file: $!"); # we expect to have \r\n at line ends, and want to keep 'em.
+ $self = $class->new(\*HDR, @opts); ### now, $self is instance or undef
+ close(HDR) or return error("close $file: $!");
$self;
}
@@ -325,11 +324,10 @@
=item decode [FORCE]
I<Instance method, DEPRECATED.>
-Go through all the header fields, looking for RFC 1522 / RFC 2047 style
-"Q" (quoted-printable, sort of) or "B" (base64) encoding, and decode
-them in-place. Fellow Americans, you probably don't know what the hell
-I'm talking about. Europeans, Russians, et al, you probably do.
-C<:-)>.
+Go through all the header fields, looking for RFC-1522-style "Q"
+(quoted-printable, sort of) or "B" (base64) encoding, and decode them
+in-place. Fellow Americans, you probably don't know what the hell I'm
+talking about. Europeans, Russians, et al, you probably do. C<:-)>.
B<This method has been deprecated.>
See L<MIME::Parser/decode_headers> for the full reasons.
@@ -528,7 +526,7 @@
sub print {
my ($self, $fh) = @_;
- $fh ||= select;
+ $fh = wraphandle($fh || select); ### get output handle, as a print()able
$fh->print($self->as_string);
}
@@ -681,10 +679,10 @@
Try I<real hard> to determine the content transfer encoding
(e.g., C<"base64">, C<"binary">), which is returned in all-lowercase.
-If no encoding could be found, the default of C<"7bit"> is returned
-I quote from RFC 2045 section 6.1:
+If no encoding could be found, the default of C<"7bit"> is returned.
+I quote from RFC-1521 section 5:
- This is the default value -- that is, "Content-Transfer-Encoding: 7BIT"
+ This is the default value -- that is, "Content-Transfer-Encoding: 7BIT"
is assumed if the Content-Transfer-Encoding header field is not present.
I do one other form of fixup: "7_bit", "7-bit", and "7 bit" are
@@ -705,21 +703,16 @@
I<Instance method.>
Try C<real hard> to determine the content type (e.g., C<"text/plain">,
-C<"image/gif">, C<"x-weird-type">, which is returned in all-lowercase.
-"Real hard" means that if no content type could be found, the default
-(usually C<"text/plain">) is returned. From RFC 2045 section 5.2:
-
- Default RFC 822 messages without a MIME Content-Type header are
- taken by this protocol to be plain text in the US-ASCII character
- set, which can be explicitly specified as:
-
- Content-type: text/plain; charset=us-ascii
-
- This default is assumed if no Content-Type header field is specified.
-
-Unless this is a part of a "multipart/digest", in which case
-"message/rfc822" is the default. Note that you can also I<set> the
-default, but you shouldn't: normally only the MIME parser uses this
+C<"image/gif">, C<"x-weird-type">, which is returned in all-lowercase.
+"Real hard" means that if no content type could be found, the default
+(usually C<"text/plain">) is returned. From RFC-1521 section 7.1:
+
+ The default Content-Type for Internet mail is
+ "text/plain; charset=us-ascii".
+
+Unless this is a part of a "multipart/digest", in which case
+"message/rfc822" is the default. Note that you can also I<set> the
+default, but you shouldn't: normally only the MIME parser uses this
feature.
=cut
@@ -737,15 +730,15 @@
=item multipart_boundary
I<Instance method.>
-If this is a header for a multipart message, return the
+If this is a header for a multipart message, return the
"encapsulation boundary" used to separate the parts. The boundary
is returned exactly as given in the C<Content-type:> field; that
is, the leading double-hyphen (C<-->) is I<not> prepended.
-Well, I<almost> exactly... this passage from RFC 2046 dictates
+Well, I<almost> exactly... this passage from RFC-1521 dictates
that we remove any trailing spaces:
- If a boundary appears to end with white space, the white space
+ If a boundary appears to end with white space, the white space
must be presumed to have been added by a gateway, and must be deleted.
Returns undef (B<not> the empty string) if either the message is not
@@ -771,22 +764,20 @@
=cut
-sub recommended_filename
-{
- my $self = shift;
-
- # Try these headers in order, taking the first defined,
- # non-blank one we find.
- foreach my $attr_name ( qw( content-disposition.filename content-type.name ) ) {
- my $value = $self->mime_attr( $attr_name );
- if ( defined $value
- && $value ne ''
- && $value =~ /\S/ ) {
- return $value;
- }
- }
+sub recommended_filename {
+ my $self = shift;
+ my $value;
+
+ ### Start by trying to get 'filename' from the 'content-disposition':
+ $value = $self->mime_attr('content-disposition.filename');
+ return $value if (defined($value) and $value ne '');
+
+ ### No? Okay, try to get 'name' from the 'content-type':
+ $value = $self->mime_attr('content-type.name');
+ return $value if (defined($value) and $value ne '');
- return undef;
+ ### Sorry:
+ undef;
}
#------------------------------
@@ -830,16 +821,18 @@
he's using the word "header" where I would use "field"; e.g.,
to refer to "Subject:", "Content-type:", etc.):
- There is also IMHO no requirement [for] MIME::Heads to look
- like [email] headers; so to speak, the MIME::Head [simply stores]
+ There is also IMHO no requirement [for] MIME::Heads to look
+ like [email] headers; so to speak, the MIME::Head [simply stores]
the attributes of a complex object, e.g.:
new MIME::Head type => "text/plain",
charset => ...,
disposition => ..., ... ;
-I agree in principle, but (alas and dammit) RFC 2045 says otherwise.
-RFC 2045 [MIME] headers are a syntactic subset of RFC-822 [email] headers.
+I agree in principle, but (alas and dammit) RFC-1521 says otherwise.
+RFC-1521 [MIME] headers are a syntactic subset of RFC-822 [email] headers.
+Perhaps a better name for these modules would be RFC1521:: instead of
+MIME::, but we're a little beyond that stage now.
In my mind's eye, I see an abstract class, call it MIME::Attrs, which does
what Achim suggests... so you could say:
@@ -852,9 +845,9 @@
would have to implement its interface, I<and> allow itself to be
initiallized from a MIME::Attrs object.
-However, when you read RFC 2045, you begin to see how much MIME information
+However, when you read RFC-1521, you begin to see how much MIME information
is organized by its presence in particular fields. I imagine that we'd
-begin to mirror the structure of RFC 2045 fields and subfields to such
+begin to mirror the structure of RFC-1521 fields and subfields to such
a degree that this might not give us a tremendous gain over just
having MIME::Head.
@@ -908,6 +901,11 @@
The more-comprehensive filename extraction is courtesy of
Lee E. Brotzman, Advanced Data Solutions.
+
+=head1 VERSION
+
+$Revision: 1.14 $ $Date: 2006/03/17 21:03:23 $
+
=cut
1;
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Parser.pm
^
|
@@ -65,8 +65,6 @@
### Change how nameless message-component files are named:
$parser->output_prefix("msg");
- ### Put temporary files somewhere else
- $parser->tmp_dir("/var/tmp/mytmpdir");
=head2 Examples of error recovery
@@ -90,7 +88,7 @@
=head2 Examples of parser options
- ### Automatically attempt to RFC 2047-decode the MIME headers?
+ ### Automatically attempt to RFC-1522-decode the MIME headers?
$parser->decode_headers(1); ### default is false
### Parse contained "message/rfc822" objects as nested MIME streams?
@@ -123,6 +121,8 @@
#------------------------------
+# We require the new FileHandle methods, and a non-buggy version
+# of FileHandle->new_tmpfile:
require 5.004;
### Pragmas:
@@ -130,7 +130,11 @@
use vars (qw($VERSION $CAT $CRLF));
### Built-in modules:
+use FileHandle ();
+use IO::Wrap;
+use IO::Scalar 1.117;
use IO::ScalarArray 1.114;
+use IO::Lines 1.108;
use IO::File;
use IO::InnerFile;
use File::Spec;
@@ -180,7 +184,7 @@
#------------------------------
### The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.426";
+$VERSION = "5.420";
### How to catenate:
$CAT = '/bin/cat';
@@ -243,12 +247,13 @@
$self->{MP5_DecodeBodies} = 1;
$self->{MP5_Interface} = {};
$self->{MP5_ParseNested} = 'NEST';
+ $self->{MP5_Tmp} = undef;
+ $self->{MP5_TmpRecycling} = 1;
$self->{MP5_TmpToCore} = 0;
$self->{MP5_IgnoreErrors} = 1;
$self->{MP5_UseInnerFiles} = 0;
$self->{MP5_UUDecode} = 0;
$self->{MP5_MaxParts} = -1;
- $self->{MP5_TmpDir} = undef;
$self->interface(ENTITY_CLASS => 'MIME::Entity');
$self->interface(HEAD_CLASS => 'MIME::Head');
@@ -274,8 +279,8 @@
$self->{MP5_Results} = new MIME::Parser::Results;
$self->{MP5_Filer}->results($self->{MP5_Results});
- $self->{MP5_Filer}->purgeable([]);
$self->{MP5_Filer}->init_parse();
+ $self->{MP5_Filer}->purgeable([]); ### just to be safe
$self->{MP5_NumParts} = 0;
1;
}
@@ -302,7 +307,7 @@
I<Instance method.>
Controls whether the parser will attempt to decode all the MIME headers
-(as per RFC 2047) the moment it sees them. B<This is not advisable
+(as per RFC-1522) the moment it sees them. B<This is not advisable
for two very important reasons:>
=over
@@ -671,7 +676,7 @@
@headlines and
$self->error("couldn't parse head; error near:\n",@headlines);
- ### If desired, auto-decode the header as per RFC 2047
+ ### If desired, auto-decode the header as per RFC-1522.
### This shouldn't affect non-encoded headers; however, it will decode
### headers with international characters. WARNING: currently, the
### character-set information is LOST after decoding.
@@ -699,7 +704,7 @@
$self->debug("process_multipart...");
### Get actual type and subtype from the header:
- my ($type, $subtype) = (split('/', $head->mime_type, -1), '');
+ my ($type, $subtype) = (split('/', $head->mime_type), "");
### If this was a type "multipart/digest", then the RFCs say we
### should default the parts to have type "message/rfc822".
@@ -797,7 +802,8 @@
}
else {
$self->debug("using temp file");
- $ENCODED = $self->new_tmpfile();
+ $ENCODED = $self->new_tmpfile($self->{Tmp});
+ $self->{Tmp} = $ENCODED if $self->{TmpRecycle};
}
### Read encoded body until boundary (or EOF)...
@@ -920,10 +926,10 @@
$self->whine("Found a $how_encoded attachment");
my $pre;
while (1) {
- my $bin_data = '';
+ my @bin_data;
### Try next part:
- my $out = IO::File->new(\$bin_data, '>:');
+ my $out = IO::ScalarArray->new(\@bin_data);
eval { $decoder->decode($ENCODED, $out) }; last if $@;
my $preamble = $decoder->last_preamble;
my $filename = $decoder->last_filename;
@@ -959,7 +965,7 @@
$bin_ent->bodyhandle($self->new_body_for($bin_ent->head));
$bin_ent->bodyhandle->binmode(1) or die "$ME: can't set to binmode: $!";
my $io = $bin_ent->bodyhandle->open("w") or die "$ME: can't create: $!";
- $io->print($bin_data) or die "$ME: can't print: $!";
+ $io->print(@bin_data) or die "$ME: can't print: $!";
$io->close or die "$ME: can't close: $!";
push @parts, $bin_ent;
}
@@ -1065,7 +1071,7 @@
$head->mime_type($p{Retype}) if $p{Retype};
### Get the MIME type and subtype:
- my ($type, $subtype) = (split('/', $head->mime_type, -1), '');
+ my ($type, $subtype) = (split('/', $head->mime_type), '');
$self->debug("type = $type, subtype = $subtype");
### Handle, according to the MIME type:
@@ -1132,19 +1138,18 @@
### Get data as a scalar:
my $io;
-
- if (! ref $data ) {
- $io = IO::File->new(\$data, '<:');
- } elsif( ref $data eq 'SCALAR' ) {
- $io = IO::File->new($data, '<:');
- } elsif( ref $data eq 'ARRAY' ) {
- # Unfortunately, if they give us an array, we have to keep
- # using it. We don't really want to make a copy.
- # TODO: I think we're stuck keeping this one for now.
- $io = IO::ScalarArray->new($data);
- } else {
- croak "parse_data: wrong argument ref type: ", ref($data);
- }
+ switch: while(1) {
+ (!ref($data)) and do {
+ $io = new IO::Scalar \$data; last switch;
+ };
+ (ref($data) eq 'SCALAR') and do {
+ $io = new IO::Scalar $data; last switch;
+ };
+ (ref($data) eq 'ARRAY') and do {
+ $io = new IO::ScalarArray $data; last switch;
+ };
+ croak "parse_data: wrong argument ref type: ", ref($data);
+ }
### Parse!
return $self->parse($io);
@@ -1157,9 +1162,10 @@
I<Instance method.>
Takes a MIME-stream and splits it into its component entities.
-The INSTREAM can be given as an IO::File, a globref filehandle (like
-C<\*STDIN>), or as I<any> blessed object conforming to the IO::
-interface (which minimally implements getline() and read()).
+The INSTREAM can be given as a readable FileHandle, an IO::File,
+a globref filehandle (like C<\*STDIN>),
+or as I<any> blessed object conforming to the IO:: interface
+(which minimally implements getline() and read()).
Returns the parsed MIME::Entity on success.
Throws exception on failure. If the message contained too many
@@ -1169,7 +1175,7 @@
sub parse {
my $self = shift;
- my $in = shift;
+ my $in = wraphandle(shift); ### coerce old-style filehandles to objects
my $entity;
local $/ = "\n"; ### just to be safe
@@ -1241,13 +1247,13 @@
sub parse_two {
my ($self, $headfile, $bodyfile) = @_;
- my $data;
+ my @lines;
foreach ($headfile, $bodyfile) {
open IN, "<$_" or die "$ME: open $_: $!";
- $data .= do { local $/; <IN> };
+ push @lines, <IN>;
close IN or die "$ME: can't close: $!";
}
- return $self->parse_data($data);
+ return $self->parse_data(\@lines);
}
=back
@@ -1476,25 +1482,30 @@
$self->{MP5_FilerToCore};
}
+#------------------------------
-=item tmp_recycling
-
-I<Instance method, DEPRECATED.>
-
-This method is a no-op to preserve the pre-5.421 API.
+=item tmp_recycling [YESNO]
-The tmp_recycling() feature was removed in 5.421 because it had never actually
-worked. Please update your code to stop using it.
+I<Instance method.>
+Normally, tmpfiles are created when needed during parsing, and
+destroyed automatically when they go out of scope. But for efficiency,
+you might prefer for your parser to attempt to rewind and reuse the
+same file until the parser itself is destroyed.
+
+If YESNO is true (the default), we allow recycling;
+tmpfiles persist until the parser itself is destroyed.
+If YESNO is false, we do not allow recycling;
+tmpfiles persist only as long as they are needed during the parse.
+With no argument, just returns the current setting.
=cut
-sub tmp_recycling
-{
- return;
+sub tmp_recycling {
+ my ($self, $yesno) = @_;
+ $self->{MP5_TmpRecycling} = $yesno if (@_ > 1);
+ $self->{MP5_TmpRecycling};
}
-
-
#------------------------------
=item tmp_to_core [YESNO]
@@ -1630,48 +1641,13 @@
#------------------------------
-=pod
-
-=back
-
-=head2 Temporary File Creation
-
-=over
-
-=item tmp_dir DIRECTORY
-
-I<Instance method.>
-Causes any temporary files created by this parser to be created in the
-given DIRECTORY.
-
-If called without arguments, returns current value.
-
-The default value is undef, which will cause new_tmpfile() to use the
-system default temporary directory.
-
-=cut
-
-sub tmp_dir
-{
- my ($self, $dirname) = @_;
- if ( $dirname ) {
- $self->{MP5_TmpDir} = $dirname;
- }
-
- return $self->{MP5_TmpDir};
-}
-
-=item new_tmpfile
+=item new_tmpfile [RECYCLE]
I<Instance method.>
Return an IO handle to be used to hold temporary data during a parse.
-
-The default uses MIME::Tools::tmpopen() to create a new temporary file,
-unless L<tmp_to_core()|/tmp_to_core> dictates otherwise, but you can
-override this. You shouldn't need to.
-
-The location for temporary files can be changed on a per-parser basis
-with L<tmp_dir()>.
+The default uses the standard IO::File->new_tmpfile() method unless
+L<tmp_to_core()|/tmp_to_core> dictates otherwise, but you can override this.
+You shouldn't need to.
If you do override this, make certain that the object you return is
set for binmode(), and is able to handle the following methods:
@@ -1685,22 +1661,34 @@
Fatal exception if the stream could not be established.
+If RECYCLE is given, it is an object returned by a previous invocation
+of this method; to recycle it, this method must effectively rewind and
+truncate it, and return the same object. If you don't want to support
+recycling, just ignore it and always return a new object.
+
=cut
sub new_tmpfile {
- my ($self) = @_;
+ my ($self, $recycle) = @_;
my $io;
- if ($self->{MP5_TmpToCore}) {
- my $var;
- $io = IO::File->new(\$var, '+>:') or die "$ME: Can't open in-core tmpfile: $!";
- } else {
- my $args = {};
- if( $self->tmp_dir ) {
- $args->{DIR} = $self->tmp_dir;
+ if ($self->{MP5_TmpToCore}) { ### Use an in-core tmpfile (slow)
+ $io = IO::ScalarArray->new;
+ }
+ else { ### Use a real tmpfile (fast)
+ ### Recycle?
+ if ($self->{TmpRecycling} && ### we're recycling
+ $recycle && ### something to recycle
+ $Config{'truncate'} && $io->can('seek') ### recycling will work
+ ){
+ $self->debug("recycling tmpfile: $io");
+ $io->seek(0, 0) or die "$ME: can't seek: $!";
+ truncate($io, 0) or die "$ME: can't truncate: $!";
+ }
+ else { ### Return a new one:
+ $io = tmpopen() or die "$ME: can't open tmpfile: $!\n";
+ binmode($io) or die "$ME: can't set to binmode: $!";
}
- $io = tmpopen( $args ) or die "$ME: can't open tmpfile: $!\n";
- binmode($io) or die "$ME: can't set to binmode: $!";
}
return $io;
}
@@ -1802,6 +1790,7 @@
extract_nested_messages() 0 (may be slightly faster, but in
general you want it set to 1)
output_to_core() 0 (will be MUCH faster)
+ tmp_recycling() 1? (probably, but should be investigated)
tmp_to_core() 0 (will be MUCH faster)
use_inner_files() 0 (if tmp_to_core() is 0;
use 1 otherwise)
@@ -1849,6 +1838,7 @@
decode_headers() *** (no real difference)
extract_nested_messages() *** (no real difference)
output_to_core() 0 (will use MUCH less memory)
+ tmp_recycling() 0? (promotes faster GC if
tmp_to_core is 1)
tmp_to_core() 0 (will use MUCH less memory)
use_inner_files() *** (no real difference, but set it to 1
@@ -1871,6 +1861,7 @@
extract_nested_messages() 0 (sidesteps problems of bad nested messages,
but often you want it set to 1 anyway).
output_to_core() *** (doesn't matter)
+ tmp_recycling() *** (doesn't matter)
tmp_to_core() *** (doesn't matter)
use_inner_files() *** (doesn't matter)
@@ -1889,6 +1880,7 @@
decode_headers() *** (doesn't matter)
extract_nested_messages() *** (doesn't matter)
output_to_core() *** (doesn't matter)
+ tmp_recycling 1 (restricts created files to 1 per parser)
tmp_to_core() 1
use_inner_files() 1
@@ -1956,7 +1948,7 @@
=item Fuzzing of CRLF and newline on input
-RFC 2045 dictates that MIME streams have lines terminated by CRLF
+RFC-1521 dictates that MIME streams have lines terminated by CRLF
(C<"\r\n">). However, it is extremely likely that folks will want to
parse MIME streams where each line ends in the local newline
character C<"\n"> instead.
@@ -1980,14 +1972,14 @@
=item Inability to handle multipart boundaries that contain newlines
First, let's get something straight: I<this is an evil, EVIL practice,>
-and is incompatible with RFC 2046... hence, it's not valid MIME.
+and is incompatible with RFC-1521... hence, it's not valid MIME.
If your mailer creates multipart boundary strings that contain
newlines I<when they appear in the message body,> give it two weeks notice
and find another one. If your mail robot receives MIME mail like this,
regard it as syntactically incorrect MIME, which it is.
-Why do I say that? Well, in RFC 2046, the syntax of a boundary is
+Why do I say that? Well, in RFC-1521, the syntax of a boundary is
given quite clearly:
boundary := 0*69<bchars> bcharsnospace
@@ -2039,4 +2031,10 @@
All rights reserved. This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
+
+
+=head1 VERSION
+
+$Revision: 1.20 $ $Date: 2006/03/17 21:03:23 $
+
=cut
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Parser/Filer.pm
^
|
@@ -929,3 +929,8 @@
All rights reserved. This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
+
+=head1 VERSION
+
+$Revision: 1.6 $
+
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Parser/Reader.pm
^
|
@@ -184,8 +184,8 @@
#
sub native_handle {
my $fh = shift;
- return $fh if $fh->isa('IO::File');
- return $fh if (ref $fh eq 'GLOB');
+ return $fh if $fh->isa('IO::File');
+ return $$fh if ($fh->isa('IO::Wrap') && (ref($$fh) eq 'GLOB'));
undef;
}
@@ -203,7 +203,7 @@
# EOF end of file
# Parse up to (and including) the boundary, and dump output.
-# Follows the RFC 2046 specification, that the CRLF immediately preceding
+# Follows the RFC-1521 specification, that the CRLF immediately preceding
# the boundary is part of the boundary, NOT part of the input!
#
# NOTE: while parsing, we take care to remember the EXACT end-of-line
@@ -296,7 +296,6 @@
#
sub read_lines {
my ($self, $in, $outlines) = @_;
- # TODO: we are also stuck keeping this one for now
$self->read_chunk($in, IO::ScalarArray->new($outlines));
shift @$outlines if ($outlines->[0] eq ''); ### leading empty line
1;
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Parser/Results.pm
^
|
@@ -181,3 +181,18 @@
All rights reserved. This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
+
+=head1 VERSION
+
+$Revision: 1.1 $
+
+
+
+
+
+
+
+
+
+
+
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Tools.pm
^
|
@@ -7,12 +7,13 @@
use strict;
use vars (qw(@ISA %CONFIG @EXPORT_OK %EXPORT_TAGS $VERSION $ME
- $M_DEBUG $M_WARNING $M_ERROR ));
+ $M_DEBUG $M_WARNING $M_ERROR
+ $Tmpopen ));
require Exporter;
-use IO::File;
-use File::Temp 0.18 ();
+use FileHandle;
use Carp;
+use Benchmark;
$ME = "MIME-tools";
@@ -23,12 +24,12 @@
'config' => [qw(%CONFIG)],
'msgs' => [qw(usage debug whine error)],
'msgtypes'=> [qw($M_DEBUG $M_WARNING $M_ERROR)],
- 'utils' => [qw(textual_type tmpopen )],
+ 'utils' => [qw(catfile shellquote textual_type tmpopen )],
);
Exporter::export_ok_tags('config', 'msgs', 'msgtypes', 'utils');
# The TOOLKIT version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.426";
+$VERSION = "5.420";
# Configuration (do NOT alter this directly)...
# All legal CONFIG vars *must* be in here, even if only to be set to undef:
@@ -152,6 +153,38 @@
#------------------------------
#
+# catfile DIR, FILE
+#
+# Directory/file concatenation.
+#
+sub catfile {
+ my ($parent, $child) = @_;
+ if ($^O eq 'Mac') {
+ $parent =~ s{:\Z}{};
+ return "$parent:$child";
+ }
+ else {
+ $parent =~ s{/\Z}{};
+ return "$parent/$child";
+ }
+}
+
+#------------------------------
+#
+# shellquote STRING
+#
+# Private utility: make string safe for shell.
+#
+sub shellquote {
+ my $str = shift;
+ $str =~ s/\$/\\\$/g;
+ $str =~ s/\`/\\`/g;
+ $str =~ s/\"/\\"/g;
+ return "\"$str\""; # wrap in double-quotes
+}
+
+#------------------------------
+#
# textual_type MIMETYPE
#
# Function. Does the given MIME type indicate a textlike document?
@@ -165,13 +198,16 @@
# tmpopen
#
#
-sub tmpopen
-{
- my ($args) = @_;
- $args ||= {};
- return File::Temp->new( %{$args} );
+sub tmpopen {
+ &$Tmpopen();
}
+$Tmpopen = sub { IO::File->new_tmpfile; };
+
+
+
+
+
#------------------------------
1;
package MIME::ToolUtils;
@@ -250,7 +286,7 @@
File::Path
File::Spec
IPC::Open2 (optional)
- IO::ScalarArray from the IO-stringy distribution
+ IO::Scalar, ... from the IO-stringy distribution
MIME::Base64
MIME::QuotedPrint
Net::SMTP
@@ -332,9 +368,10 @@
=item *
B<You can open() a "body" and get an "I/O handle" to read/write message data.>
-This handle is an object that is basically like an IO::Handle... it
-can be any class, so long as it supports a small, standard set of
-methods for reading from or writing to the underlying data source.
+This handle is an object that is basically like an IO::Handle or
+a FileHandle... it can be any class, so long as it supports a small,
+standard set of methods for reading from or writing to the underlying
+data source.
=back
@@ -382,9 +419,9 @@
A B<MIME::Body>, which is a object that knows where the body data is.
You ask this object to "open" itself for reading, and it
-will hand you back an "I/O handle" for reading the data: this could be
-of any class, so long as it conforms to a subset of the B<IO::Handle>
-interface.
+will hand you back an "I/O handle" for reading the data: this is
+a FileHandle-like object, and could be of any class, so long as it
+conforms to a subset of the B<IO::Handle> interface.
=back
@@ -670,7 +707,7 @@
=head2 Fuzzing of CRLF and newline on input
-RFC 2045 dictates that MIME streams have lines terminated by CRLF
+RFC-1521 dictates that MIME streams have lines terminated by CRLF
(C<"\r\n">). However, it is extremely likely that folks will want to
parse MIME streams where each line ends in the local newline
character C<"\n"> instead.
@@ -693,11 +730,10 @@
=head2 Fuzzing of CRLF and newline when encoding/composing
-TODO FIXME
All encoders currently output the end-of-line sequence as a C<"\n">,
with the assumption that the local mail agent will perform
the conversion from newline to CRLF when sending the mail.
-However, there probably should be an option to output CRLF as per RFC 2045
+However, there probably should be an option to output CRLF as per RFC-1521.
=head2 Inability to handle multipart boundaries with embedded newlines
@@ -780,8 +816,8 @@
store a collection of attributes, and thus could be represented as
objects which don't inherit from Mail::Header.
-I agree in principle, but RFC 2045 says otherwise.
-RFC 2045 [MIME] headers are a syntactic subset of RFC-822 [email] headers.
+I agree in principle, but RFC-1521 says otherwise.
+RFC-1521 [MIME] headers are a syntactic subset of RFC-822 [email] headers.
Perhaps a better name for these modules would have been RFC1521::
instead of MIME::, but we're a little beyond that stage now.
@@ -804,9 +840,8 @@
=head2 Glossary
-Here are some definitions adapted from RFC 1521 (predecessor of the
-current RFC 204[56789] defining MIME) explaining the terminology we
-use; each is accompanied by the equivalent in MIME:: module terms...
+Here are some definitions adapted from RFC-1521 explaining the terminology
+we use; each is accompanied by the equivalent in MIME:: module terms...
=over 4
@@ -976,6 +1011,7 @@
See the COPYING file in the distribution for details.
+
=head1 SUPPORT
Please email me directly with questions/problems (see AUTHOR below).
@@ -986,9 +1022,895 @@
is using MIME-tools, it might not be a bad idea to find out about those
bugs I<before> they become problems...
+
+=head1 VERSION
+
+$Revision: 1.15 $
+
+
=head1 CHANGE LOG
-See ChangeLog file
+=over 4
+
+=item Version 5.411
+
+B<Regenerated docs.>
+Bug in HTML docs, now all fixed.
+
+=item Version 5.410 (2000/11/23)
+
+B<Better detection of evil filenames.>
+Now we check for filenames which are suspiciously long,
+and a new MIME::Filer::exorcise_filename() method is used
+to try and remove the evil.
+I<Thanks to Jason Haar for the suggestion.>
+
+
+=item Version 5.409 (2000/11/12)
+
+B<Added functionality to MIME::WordDecoder,>
+including support for plain US-ASCII.
+
+B<MIME::Tools::tmpopen()> made more flexible.
+You can now override the tmpfile-opening behavior.
+
+
+=item Version 5.408 (2000/11/10)
+
+B<Added new Beta unmime() mechanism.>
+See L<MIME::WordDecoder> for full details.
+Also see L<"Understand how international characters are represented">.
+
+
+=item Version 5.405 (2000/11/05)
+
+B<Added a purge() that does what people want it to.>
+Now, when a parse finishes and you want to delete everything that
+was created by it, you can invoke C<purge()> on the parser's filer.
+All files/directories created during the last parse should vanish.
+I<Thanks to everyone who complained about MIME::Entity::purge.>
+
+
+=item Version 5.404 (2000/11/04)
+
+B<Added new automatic MIME-decoding of attachment filenames with
+encoded (non-ASCII) characters.>
+Hopefully this will do more good than harm.
+The use of MIME::Parser::decode_headers() and MIME::Head::decode()
+has been deprecated in favor of the new MIME::Words "unmime" mechanism.
+Please see L<MIME::Words/unmime>.
+
+B<Added tolerance for unquoted =?...?= in param values.>
+This is in violation of the RFCs, but then, so are some MUAs.
+I<Thanks to desti for bringing this to my attention.>
+
+B<Fixed supposedly-bad B-encoding.>
+I<Thanks to Otto Frost for bringing this to my attention.>
+
+
+=item Version 5.316 (2000/09/21)
+
+B<Increased tolerance in MIME::Parser.>
+Now will ignore bogus POP3 "+OK" line before header, as well as bogus
+mailbox "From " line (both with warnings).
+I<Thanks to Antony OSullivan (ajos1) for suggesting this feature.>
+
+B<Fixed small epilogue-related bug in MIME::Entity::print_body().>
+Now it only outputs a final newline if the epilogue does not end
+in one already. Support for checking the preamble/epilogue in
+regression tests was also added.
+I<Thanks to Lars Hecking for bringing this issue up.>
+
+B<Updated documentation.>
+All module manual pages should now direct readers to the main
+MIME-tools manual page.
+
+
+=item Version 5.314 (2000/09/06)
+
+Fixed Makefile.PL to have less-restrictive requirement
+for File::Spec (0.6).
+
+
+=item Version 5.313 (2000/09/05)
+
+B<Fixed nasty bug with evil filenames.>
+Certain evil filenames were getting replaced by internally-generated
+filenames which were just as evil... ouch! If your parser occasionally
+throws a fatal exception with a "write-open" error message, then
+you have this bug.
+I<Thanks to Julian Field and Antony OSullivan (ajos1)
+for delivering the evidence!>
+
+ Beware the doctor
+ who cures seasonal head cold
+ by killing patient
+
+B<Improved naming of extracted files.>
+If a filename is regarded as evil, we guess that it might just
+be because of part information, and attempt to find and use the
+final path element.
+
+B<Simplified message logging and made it more consistent.>
+For details, see L<"Message-logging">.
+
+
+=item Version 5.312 (2000/09/03)
+
+B<Fixed a Perl 5.7 select() incompatibility>
+which caused "make test" to fail.
+I<Thanks to Nick Ing-Simmons for the patch.>
+
+
+=item Version 5.311 (2000/08/16)
+
+B<Blind fix for Win32 uudecoding bug.>
+A missing binmode seems to be the culprit here; let's see if this fixes it.
+I<Thanks to ajos1 for finding the culprit!>
+
+ The carriage return
+ thumbs its nose at me, laughing:
+ DOS I/O *still* sucks
+
+
+=item Version 5.310 (2000/08/15)
+
+B<Fixed a bug in the back-compat output_prefix() method of MIME::Parser.>
+Basically, output prefixes were not being set through this mechanism.
+I<Thanks to ajos1 for the alert.>
+
+ shift @_, ### "shift at-underscore"
+ or @_ will have
+ bogus "self" object
+
+B<Added some backcompat methods,> like parse_FH().
+I<Thanks (and apologies) to Alain Kotoujansky.>
+
+B<Added filenames-with-spaces support to MIME::Decoder::UU.>
+I<Thanks to Richard Pun for the suggestion.>
+
+
+=item Version 5.305 (2000/07/20)
+
+B<Added MIME::Entity::parts_DFS> as convenient way to "get all parts".
+I<Thanks to Xavier Armengou for suggesting this method.>
+
+Removed the Alpha notice.
+Still a few features to tweak, but those will be minor.
+
+
+=item Version 5.303 (2000/07/07)
+
+B<Fixed output bugs in new Filers>.
+Scads of them: bad handling of filename collisions, bad implementation
+of output_under(), bad linking to results, POD errors, you name it.
+If this had gone to CPAN, I'd have issued a factory recall. C<:-(>
+
+ Errors, like beetles,
+ Multiply ferociously
+ In the small hours
+
+
+=item Version 5.301 (2000/07/06)
+
+B<READ ME BEFORE UPGRADING PAST THIS POINT!>
+B<New MIME::Parser::Filer class -- not fully backwards-compatible.>
+In response to demand for more-comprehensive file-output strategies,
+I have decided that the best thing to do is to split all the
+file-output logic (output_path(), evil_filename(), etc.)
+into its own separate class, inheriting from the new
+L<MIME::Parser::Filer|MIME::Parser::Filer> class.
+If you I<override> any of the following in a MIME::Parser subclass,
+you will need to change your code accordingly:
+
+ evil_filename
+ output_dir
+ output_filename
+ output_path
+ output_prefix
+ output_under
+
+My sincere apologies for any inconvenience this will cause, but
+it's ultimately for the best, and is quite likely the last structural
+change to 5.x.
+I<Thanks to Tyson Ackland for all the ideas.>
+Incidentally, the new code also fixes a bug where identically-named
+files in the same message could clobber each other.
+
+ A message arrives:
+ "Here are three files, all named 'Foo'"
+ Only one survives. :-(
+
+B<Fixed bug in MIME::Words header decoding.>
+Underscores were not being handled properly.
+I<Thanks to Dominique Unruh and Doru Petrescu,> who independently
+submitted the same fix within 2 hours of each other, after this
+bug has lain dormant for months:
+
+ Two users, same bug,
+ same patch -- mere hours apart:
+ Truly, life is odd.
+
+B<Removed escaping of underscore in regexps.>
+Escaping the underscore (\_) in regexps was sloppy and wrong
+(escaped metacharacters may include anything in \w), and the newest
+Perls warn about it.
+I<Thanks to David Dyck for bringing this to my attention.>
+
+ What, then, is a word?
+ Some letters, digits, and, yes:
+ Underscores as well
+
+B<Added Force option to MIME::Entity's make_multipart>.
+I<Thanks to Bob Glickstein for suggesting this.>
+
+B<Numerous fixlets to example code.>
+I<Thanks to Doru Petrescu for these.>
+
+B<Added REQUIREMENTS section in docs.>
+Long-overdue. I<Thanks to Ingo Schmiegel for motivating this.>
+
+
+=item Version 5.211 (2000/06/24)
+
+B<Fixed auto-uudecode bug.>
+Parser was failing with "part did not end with expected boundary" error
+when uuencoded entity was a I<singlepart> message (ironically,
+uuencoded parts of multiparts worked fine).
+I<Thanks to Michael Mohlere for testing uudecode and finding this.>
+
+ The hurrying bee
+ Flies far for nectar, missing
+ The nearest flowers
+
+ Say ten thousand times:
+ Complex cases may succeed
+ Where simple ones fail
+
+B<Parse errors now generate warnings.>
+Parser errors now cause warn()s to be generated if they are
+not turned into fatal exceptions. This might be a little redundant,
+seeing as they are available in the "results", but parser-warnings
+already cause warn()s. I can always put in a "quiet" switch if
+people complain.
+
+B<Miscellaneous cleanup.>
+Documentation of MIME::Parser improved slightly, and a redundant
+warning was removed.
+
+
+=item Version 5.210 (2000/06/20)
+
+B<Change in "evil" filename.>
+Made MIME::Parser's evil_filename stricter by having it reject
+"path" characters: any of '/' '\' ':' '[' ']'.
+
+ Just as with beauty
+ The eye of the beholder
+ Is where "evil" lives.
+
+B<Documentation fixes.>
+Corrected a number of docs in MIME::Entity which were obsoleted
+in the transition from 4.x to 5.x.
+I<Thanks to Michael Fischer for pointing these out.>
+For this one, a special 5-5-5-5 Haiku of anagrams:
+
+ Documentation
+ in mutant code, O!
+ Edit -- no, CUT! [moan]
+ I meant to un-doc...
+
+B<IO::Lines usage bug fixed.>
+MIME::Entity was missing a "use IO::Lines", which caused an
+exception when you tried to use the body() method of MIME::Entity.
+I<Thanks to Hideyo Imazu and Michael Fischer for pointing this out.>
+
+ Bareword looks fine, but
+ Perl cries: "Whoa there... IO::Lines?
+ Never heard of it."
+
+
+=item Version 5.209 (2000/06/10)
+
+B<Autodetection of uuencode.>
+You can now tell the parser to hunt for uuencode inside what should
+be text parts.
+See L<extract_uuencode()|MIME::Parser/extract_uuencode> for full details.
+B<Beware:> this is largely untested at the moment.
+I<Special thanks to Michael Mohlere at ADJE Webmail, who was the
+ first -- and most-insistent -- user to request this feature.>
+
+B<Faster parsing.>
+Sped up the MIME::Decoder::NBit decoder quite a bit by using a variant
+of the chunking trick I used for MIME::Decoder::Base64. I suspect
+that the same trick (reading a big chunk plus the next line to get a
+big block of lines) would work with MIME::Decoder::QuotedPrint, but I
+don't have the time or resources to check that right now (tested
+contributions would be welcome). NBit encoding is more-conveniently
+done line-by-line for now, because individual line lengths must be
+checked.
+
+B<Better use of core.>
+MIME::Body::InCore is now used when you build() an entity with
+the Data parameter, instead of MIME::Body::Scalar.
+
+B<More documentation> on toolkit configuration.
+
+
+=item Version 5.207 (2000/06/09)
+
+B<Fixed whine() bug in MIME::Parser> where the "warning" method
+whine() was called as a static function instead of invoked as an
+instance method.
+I<Thanks to Todd A. Bradfute for reporting this.>
+
+ A simple warning
+ Invokes method as function:
+ "Warning" makes us die
+
+
+=item Version 5.206 (2000/06/08)
+
+Ahem. Cough cough:
+
+ Way too many bugs
+ Thus, a self-imposed penance:
+ Write haiku for each
+
+B<Fixed bug in MIME::Parser:> the reader was not handling the odd
+(but legal) case where a multipart boundary is followed by linear
+whitespace.
+I<Thanks to Jon Agnew for reporting this with the RFC citation.>
+
+ Legal message fails
+ And 'round the globe, thousands cry:
+ READ THE RFC
+
+Empty preambles are now handled properly by MIME::Entity when
+printing: there is now no space between the header-terminator
+and the initial boundary.
+I<Thanks to "sen_ml" for suggesting this.>
+
+ Nature hates vacuum
+ But please refrain from tossing
+ Newlines in the void
+
+Started using Benchmark for benchmarking.
+
+=item Version 5.205 (2000/06/06)
+
+Added terminating newline to all parser messages, and fixed
+small parser bug that was dropping parts when errors occurred
+in certain places.
+
+
+=item Version 5.203 (2000/06/05)
+
+Brand new parser based on new (private) MIME::Parser::Reader and
+(public) MIME::Parser::Results. Fast and yet simple and very tolerant
+of bad MIME when desired. Message reporting needs some muzzling.
+
+MIME::Parser now has ignore_errors() set true by default.
+
+
+=item Version 5.116 (2000/05/26)
+
+Removed Tmpfile.t test, which was causing a bogus failure in
+"make test". Now we require 5.004 for MIME::Parser anyway,
+so we don't need it. I<Thanks to Jonathan Cohn for reporting this.>
+
+
+=item Version 5.115 (2000/05/24)
+
+Fixed Ref.t bug, and documented how to remove parts from a MIME::Entity.
+
+
+=item Version 5.114 (2000/05/23)
+
+Entity now uses MIME::Lite-style default suggested encoding.
+
+More regression test have been added, and the "Size" tests in
+Ref.t are skipped for text document (due to CRLF differences
+between platforms).
+
+
+=item Version 5.113 (2000/05/21)
+
+B<Major speed and structural improvements to the parser.>
+ I<Major, MAJOR thanks to Noel Burton-Krahn, Jeremy Gilbert,
+ and Doru Petrescu for all the patches, benchmarking,
+ and Beta-testing!>
+
+B<Convenient new one-directory-per-message parsing mechanism.>
+ Now through C<MIME::Parser> method C<output_under()>,
+ you can tell the parser that you want it to create
+ a unique directory for each message parsed, to hold the
+ resulting parts.
+
+B<Elimination of $', $` and $&.>
+ Wow... I still can't believe I missed this. D'OH!
+ I<Thanks to Noel Burton-Krahn for all his patches.>
+
+B<Parser is more tolerant of weird EOL termination.>
+ Some mailagents are can terminate lines with "\r\r\n".
+ We're okay with that now when we extract the header.
+ I<Thanks to Joao Fonseca for pointing this out.>
+
+B<Parser is tolerant of "From " lines in headers.>
+ I<Thanks to Joachim Wieland, Anthony Hinsinger, Marius Stan,
+ and numerous others.>
+
+B<Parser catches syntax errors in headers.>
+ I<Thanks to Russell P. Sutherland for catching this.>
+
+B<Parser no longer warns when subtype is undefined.>
+ I<Thanks to Eric-Olivier Le Bigot for his fix.>
+
+B<Better integration with Mail::Internet.>
+ For example, smtpsend() should work fine.
+ I<Thanks to Michael Fischer and others for the patch.>
+
+B<Miscellaneous cleanup.>
+ I<Thanks to Marcus Brinkmann for additional helpful input.>
+ I<Thanks to Klaus Seidenfaden for good feedback on 5.x Alpha!>
+
+
+
+
+=item Version 4.123 (1999/05/12)
+
+Cleaned up some of the tests for non-Unix OS'es.
+Will require a few iterations, no doubt.
+
+
+=item Version 4.122 (1999/02/09)
+
+B<Resolved CORE::open warnings for 5.005.>
+ I<Thanks to several folks for this bug report.>
+
+
+=item Version 4.121 (1998/06/03)
+
+B<Fixed MIME::Words infinite recursion.>
+ I<Thanks to several folks for this bug report.>
+
+
+=item Version 4.117 (1998/05/01)
+
+B<Nicer MIME::Entity::build.>
+ No longer outputs warnings with undefined Filename, and now
+ accepts Charset as well.
+ I<Thanks to Jason Tibbits III for the inspirational patch.>
+
+B<Documentation fixes.>
+ Hopefully we've seen the last of the pod2man warnings...
+
+B<Better test logging.>
+ Now uses ExtUtils::TBone.
+
+
+=item Version 4.116 (1998/02/14)
+
+B<Bug fix:>
+ MIME::Head and MIME::Entity were not downcasing the
+ content-type as they claimed. This has now been fixed.
+ I<Thanks to Rodrigo de Almeida Siqueira for finding this.>
+
+
+=item Version 4.114 (1998/02/12)
+
+B<Gzip64-encoding has been improved, and turned off as a default,>
+ since it depends on having gzip installed.
+ See MIME::Decoder::Gzip64 if you want to activate it in your app.
+ You can now set up the gzip/gunzip commands to use, as well.
+ I<Thanks to Paul J. Schinder for finding this bug.>
+
+
+=item Version 4.113 (1998/01/20)
+
+B<Bug fix:>
+ MIME::ParserBase was accidentally folding newlines in header fields.
+ I<Thanks to Jason L. Tibbitts III for spotting this.>
+
+
+=item Version 4.112 (1998/01/17)
+
+B<MIME::Entity::print_body now recurses> when printing multipart
+ entities, and prints "everything following the header." This is more
+ likely what people expect to happen. PLEASE read the
+ "two body problem" section of MIME::Entity's docs.
+
+
+=item Version 4.111 (1998/01/14)
+
+Clean build/test on Win95 using 5.004. Whew.
+
+
+=item Version 4.110 (1998/01/11)
+
+B<Added> make_multipart() and make_singlepart() in MIME::Entity.
+
+B<Improved> handling/saving of preamble/epilogue.
+
+
+=item Version 4.109 (1998/01/10)
+
+=over 4
+
+=item Overall
+
+B<Major version shift to 4.x>
+ accompanies numerous structural changes, and
+ the deletion of some long-deprecated code. Many apologies to those
+ who are inconvenienced by the upgrade.
+
+B<MIME::IO deprecated.>
+ You'll see IO::Scalar, IO::ScalarArray, and IO::Wrap
+ to make this toolkit work.
+
+B<MIME::Entity deep code.>
+ You can now deep-copy MIME entities (except for on-disk data files).
+
+
+=item Encoding/decoding
+
+B<MIME::Latin1 deprecated, and 8-to-7 mapping removed.>
+ Really, MIME::Latin1 was one of my more dumber ideas.
+ It's still there, but if you want to map 8-bit characters to
+ Latin1 ASCII approximations when 7bit encoding, you'll have to
+ request it explicitly. I<But use quoted-printable for your 8-bit
+ documents; that's what it's there for!>
+
+B<7bit and 8bit "encoders" no longer encode.>
+ As per RFC-2045, these just do a pass-through of the data,
+ but they'll warn you if you send bad data through.
+
+B<MIME::Entity suggests encoding.>
+ Now you can ask MIME::Entity's build() method to "suggest"
+ a legal encoding based on the body and the content-type.
+ No more guesswork! See the "mimesend" example.
+
+B<New module structure for MIME::Decoder classes.>
+ It should be easier for you to see what's happening.
+
+B<New MIME decoders!>
+ Support added for decoding C<x-uuencode>, and for
+ decoding/encoding C<x-gzip64>. You'll need "gzip" to make
+ the latter work.
+
+B<Quoted-printable back on track... and then some.>
+ The 'quoted-printable' decoder now uses the newest MIME::QuotedPrint,
+ and amends its output with guideline #8 from RFC2049 (From/.).
+ I<Thanks to Denis N. Antonioli for suggesting this.>
+
+=item Parsing
+
+B<Preamble and epilogue are now saved.>
+ These are saved in the parsed entities as simple
+ string-arrays, and are output by print() if there.
+ I<Thanks to Jason L. Tibbitts for suggesting this.>
+
+B<The "multipart/digest" semantics are now preserved.>
+ Parts of digest messages have their mime_type() defaulted
+ to "message/rfc822" instead of "text/plain", as per the RFC.
+ I<Thanks to Carsten Heyl for suggesting this.>
+
+=item Output
+
+B<Well-defined, more-complete print() output.>
+ When printing an entity, the output is now well-defined if the
+ entity came from a MIME::Parser, even if using parse_nested_messages.
+ See MIME::Entity for details.
+
+B<You can prevent recommended filenames from being output.>
+ This possible security hole has been plugged; when building MIME
+ entities, you can specify a body path but suppress the filename
+ in the header.
+ I<Thanks to Jason L. Tibbitts for suggesting this.>
+
+=item Bug fixes
+
+B<Win32 installations should work.>
+ The binmode() calls should work fine on Win32 now.
+ I<Thanks to numerous folks for their patches.>
+
+B<MIME::Head::add()> now no longer downcases its argument.
+ I<Thanks to Brandon Browning & Jason L. Tibbitts for finding this bug.>
+
+=back
+
+
+
+
+
+
+=item Version 3.204
+
+B<Bug in MIME::Head::original_text fixed.>
+ Well, it took a while, but another bug surfaced from my transition
+ from 1.x to 2.x. This method was, quite idiotically, sorting the
+ header fields.
+ I<Thanks, as usual, to Andreas Koenig for spotting this one.>
+
+B<MIME::ParserBase no longer defaults to RFC-1522-decoding headers.>
+ The documentation correctly stated that the default setting was
+ to I<not> RFC-1522-decode the headers. The code, on the other hand,
+ was init'ing this parser option in the "on" position.
+ This has been fixed.
+
+B<MIME::ParserBase::parse_nested_messages reexamined.>
+ If you use this feature, please re-read the documentation.
+ It explains a little more precisely what the ramifications are.
+
+B<MIME::Entity tries harder to ensure MIME compliance.>
+ It is now a fatal error to use certain bad combinations of content
+ type and encoding when "building", or to attempt to "attach" to
+ anything that is not a multipart document. My apologies if this
+ inconveniences anyone, but it was just too darn easy before for folks
+ to create bad MIME, and gosh darn it, good libraries should at least
+ I<try> to protect you from mistakes.
+
+B<The "make" now halts if you don't have the right stuff,>
+ provided your MakeMaker supports PREREQ_PM. See L<"REQUIREMENTS">
+ for what you need to install this package. I still provide
+ old courtesy copies of the MIME:: decoding modules.
+I<Thanks to Hugo van der Sanden for suggesting this.>
+
+B<The "make test" is far less chatty.>
+ Okay, okay, STDERR is evil. Now a C<"make test"> will just give you
+ the important stuff: do a C<"make test TEST_VERBOSE=1"> if you want
+ the gory details (advisable if sending me a bug report).
+I<Thanks to Andreas Koenig for suggesting this.>
+
+
+=item Version 3.203
+
+B<No, there haven't been any major changes between 2.x and 3.x.>
+ The major-version increase was from a few more tweaks to get $VERSION
+ to be calculated better and more efficiently (I had been using RCS
+ version numbers in a way which created problems for users of CPAN::).
+ After a couple of false starts, all modules have been upgraded to RCS
+ 3.201 or higher.
+
+B<You can now parse a MIME message from a scalar,>
+ an array-of-scalars, or any MIME::IO-compliant object (including IO::
+ objects.) Take a look at parse_data() in MIME::ParserBase. The
+ parser code has been modified to support the MIME::IO interface.
+ I<Thanks to fellow Chicagoan Tim Pierce (and countless others)
+ for asking.>
+
+B<More sensible toolkit configuration.>
+ A new config() method in MIME::ToolUtils makes a lot of toolkit-wide
+ configuration cleaner. Your old calls will still work, but with
+ deprecation warnings.
+
+B<You can now sign messages> just like in Mail::Internet.
+ See MIME::Entity for the interface.
+
+B<You can now remove signatures from messages> just like in Mail::Internet.
+ See MIME::Entity for the interface.
+
+B<You can now compute/strip content lengths>
+ and other non-standard MIME fields.
+ See sync_headers() in MIME::Entity.
+ I<Thanks to Tim Pierce for bringing the basic problem to my attention.>
+
+B<Many warnings are now silent unless $^W is true.>
+ That means unless you run your Perl with C<-w>, you won't see
+ deprecation warnings, non-fatal-error messages, etc.
+ But of course you run with C<-w>, so this doesn't affect you. C<:-)>
+
+B<Completed the 7-bit encodings in MIME::Latin1.>
+ We hadn't had complete coverage in the conversion from 8- to 7-bit;
+ now we do. I<Thanks to Rolf Nelson for bringing this to my attention.>
+
+B<Fixed broken parse_two() in MIME::ParserBase.>
+ BTW, if your code worked with the "broken" code, it should I<still>
+ work.
+ I<Thanks again to Tim Pierce for bringing this to my attention.>
+
+
+=item Version 2.14
+
+Just a few bug fixes to improve compatibility with Mail-Tools 1.08,
+and with the upcoming Perl 5.004 release.
+I<Thanks to Jason L. Tibbitts III for reporting the problems so quickly.>
+
+
+=item Version 2.13
+
+=over 4
+
+=item New features
+
+B<Added RFC-1522-style decoding of encoded header fields.>
+ Header decoding can now be done automatically during parsing via the
+ new C<decode()> method in MIME::Head... just tell your parser
+ object that you want to C<decode_headers()>.
+ I<Thanks to Kent Boortz for providing the idea, and the baseline
+ RFC-1522-decoding code!>
+
+B<Building MIME messages is even easier.>
+ Now, when you use MIME::Entity's C<build()> or C<attach()>,
+ you can also supply individual
+ mail headers to set (e.g., C<-Subject>, C<-From>, C<-To>).
+
+Added C<Disposition> to MIME::Entity's C<build()> method.
+ I<Thanks to Kurt Freytag for suggesting this feature.>
+
+An C<X-Mailer> header is now output
+ by default in all MIME-Entity-prepared messages,
+ so any bad MIME we generate can be traced back to this toolkit.
+
+Added C<purge()> method to MIME::Entity for deleteing leftover files.
+ I<Thanks to Jason L. Tibbitts III for suggesting this feature.>
+
+Added C<seek()> and C<tell()> methods to built-in MIME::IO classes.
+ Only guaranteed to work when reading!
+ I<Thanks to Jason L. Tibbitts III for suggesting this feature.>
+
+When parsing a multipart message with apparently no boundaries,
+ the error message you get has been improved.
+ I<Thanks to Andreas Koenig for suggesting this.>
+
+=item Bug fixes
+
+B<Patched over a Perl 5.002 (and maybe earlier and later) bug involving
+FileHandle::new_tmpfile.> It seems that the underlying filehandles
+were not being closed when the FileHandle objects went out of scope!
+There is now an internal routine that creates true FileHandle
+objects for anonymous temp files.
+I<Thanks to Dragomir R. Radev and Zyx for reporting the weird behavior
+that led to the discovery of this bug.>
+
+MIME::Entity's C<build()> method now warns you if you give it an illegal
+boundary string, and substitutes one of its own.
+
+MIME::Entity's C<build()> method now generates safer, fully-RFC-1521-compliant
+boundary strings.
+
+Bug in MIME::Decoder's C<install()> method was fixed.
+I<Thanks to Rolf Nelson and Nickolay Saukh for finding this.>
+
+Changed FileHandle::new_tmpfile to FileHandle->new_tmpfile, so some
+Perl installations will be happier.
+I<Thanks to Larry W. Virden for finding this bug.>
+
+Gave C<=over> an arg of 4 in all PODs.
+I<Thanks to Larry W. Virden for pointing out the problems of bare =over's>
+
+=back
+
+
+=item Version 2.04
+
+B<A bug in MIME::Entity's output method was corrected.>
+MIME::Entity::print now outputs everything to the desired filehandle
+explicitly.
+I<Thanks to Jake Morrison for pointing out the incompatibility
+with Mail::Header.>
+
+
+=item Version 2.03
+
+B<Fixed bug in autogenerated filenames> resulting from transposed "if"
+statement in MIME::Parser, removing spurious printing of header as well.
+(Annoyingly, this bug is invisible if debugging is turned on!)
+I<Thanks to Andreas Koenig for bringing this to my attention.>
+
+Fixed bug in MIME::Entity::body() where it was using the bodyhandle
+completely incorrectly.
+I<Thanks to Joel Noble for bringing this to my attention.>
+
+Fixed MIME::Head::VERSION so CPAN:: is happier.
+I<Thanks to Larry Virden for bringing this to my attention.>
+
+Fixed undefined-variable warnings when dumping skeleton
+(happened when there was no Subject: line)
+I<Thanks to Joel Noble for bringing this to my attention.>
+
+
+=item Version 2.02
+
+B<Stupid, stupid bugs in both BASE64 encoding and decoding were fixed.>
+I<Thanks to Phil Abercrombie for locating them.>
+
+
+=item Version 2.01
+
+B<Modules now inherit from the new Mail:: modules!>
+This means big changes in behavior.
+
+B<MIME::Parser can now store message data in-core.>
+There were a I<lot> of requests for this feature.
+
+B<MIME::Entity can now compose messages.>
+There were a I<lot> of requests for this feature.
+
+Added option to parse C<"message/rfc822"> as a pseduo-multipart document.
+I<Thanks to Andreas Koenig for suggesting this.>
+
+
+
+
+
+=item Version 1.13
+
+MIME::Head now no longer requires space after ":", although
+either a space or a tab after the ":" will be swallowed
+if there.
+I<Thanks to Igor Starovoitov for pointing out this shortcoming.>
+
+=item Version 1.12
+
+Fixed bugs in parser where CRLF-terminated lines were
+blowing out the handling of preambles/epilogues.
+I<Thanks to Russell Sutherland for reporting this bug.>
+
+Fixed idiotic is_multipart() bug.
+I<Thanks to Andreas Koenig for noticing it.>
+
+Added untested binmode() calls to parser for DOS, etc.
+systems. No idea if this will work...
+
+Reorganized the output_path() methods to allow easy use
+of inheritance, as per Achim Bohnet's suggestion.
+
+Changed MIME::Head to report mime_type more accurately.
+
+POSIX module no longer loaded by Parser if perl >= 5.002.
+Hey, 5.001'ers: let me know if this breaks stuff, okay?
+
+Added unsupported ./examples directory.
+
+=item Version 1.11
+
+Converted over to using Makefile.PL.
+I<Thanks to Andreas Koenig for the much-needed kick in the pants...>
+
+Added t/*.t files for testing. Eeeeeeeeeeeh...it's a start.
+
+Fixed bug in default parsing routine for generating
+output paths; it was warning about evil filenames if
+there simply I<were> no recommended filenames. D'oh!
+
+Fixed redefined parts() method in Entity.
+
+Fixed bugs in Head where field name wasn't being case folded.
+
+=item Version 1.10
+
+A typo was causing the epilogue of an inner multipart
+message to be swallowed to the end of the OUTER multipart
+message; this has now been fixed.
+I<Thanks to Igor Starovoitov for reporting this bug.>
+
+A bad regexp for parameter names was causing
+some parameters to be parsed incorrectly; this has also
+been fixed.
+I<Thanks again to Igor Starovoitov for reporting this bug.>
+
+It is now possible to get full control of the filenaming
+algorithm before output files are generated, and the default
+algorithm is safer.
+I<Thanks to Laurent Amon for pointing out the problems, and suggesting
+some solutions.>
+
+Fixed illegal "simple" multipart test file. D'OH!
+
+=item Version 1.9
+
+No changes: 1.8 failed CPAN registration
+
+=item Version 1.8
+
+Fixed incompatibility with 5.001 and FileHandle::new_tmpfile
+Added COPYING file, and improved README.
+
+=back
+
+
+
=head1 AUTHOR
@@ -1049,7 +1971,8 @@
=head1 SEE ALSO
-At the time of this writing, the MIME-tools homepage was
+At the time of this writing ($Date: 2006/03/17 21:03:23 $), the
+MIME-tools homepage was
F<http://www.mimedefang.org/static/mime-tools.php>. Check there for
updates and support.
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/WordDecoder.pm
^
|
@@ -3,7 +3,7 @@
=head1 NAME
-MIME::WordDecoder - decode RFC 2047 encoded words to a local representation
+MIME::WordDecoder - decode RFC-1522 encoded words to a local representation
=head1 SYNOPSIS
@@ -574,6 +574,11 @@
$DecoderFor{"ISO-8859-$_"} = MIME::WordDecoder::ISO_8859->new($_);
}
+{
+ package main; no strict; local $^W = 0;
+ my @x = <::DATA>;
+ eval join('',<::DATA>) || die $@ unless caller();
+}
1; # end the module
__END__
@@ -583,6 +588,11 @@
Eryq (F<eryq@zeegee.com>), ZeeGee Software Inc (F<http://www.zeegee.com>).
David F. Skoll (dfs@roaringpenguin.com) http://www.roaringpenguin.com
+
+=head1 VERSION
+
+$Revision: 1.3 $ $Date: 2005/04/19 16:23:40 $
+
=cut
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/lib/MIME/Words.pm
^
|
@@ -3,7 +3,7 @@
=head1 NAME
-MIME::Words - deal with RFC 2047 encoded words
+MIME::Words - deal with RFC-1522 encoded words
=head1 SYNOPSIS
@@ -94,7 +94,7 @@
#------------------------------
### The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.426";
+$VERSION = "5.420";
### Nonprintables (controls + x7F + 8bit):
my $NONPRINT = "\\x00-\\x1F\\x7F-\\xFF";
@@ -117,7 +117,7 @@
# almost, but not exactly, quoted-printable. :-P
sub _encode_Q {
my $str = shift;
- $str =~ s{([ _\?\=$NONPRINT])}{sprintf("=%02X", ord($1))}eog;
+ $str =~ s{([_\?\=$NONPRINT])}{sprintf("=%02X", ord($1))}eog;
$str;
}
@@ -142,7 +142,7 @@
=item decode_mimewords ENCODED, [OPTS...]
I<Function.>
-Go through the string looking for RFC 2047-style "Q"
+Go through the string looking for RFC-1522-style "Q"
(quoted-printable, sort of) or "B" (base64) encoding, and decode them.
B<In an array context,> splits the ENCODED string into a list of decoded
@@ -293,7 +293,7 @@
=back
B<Warning:> this is a quick-and-dirty solution, intended for character
-sets which overlap ASCII. B<It does not comply with the RFC 2047
+sets which overlap ASCII. B<It does not comply with the RFC-1522
rules regarding the use of encoded words in message headers>.
You may want to roll your own variant,
using C<encoded_mimeword()>, for your application.
@@ -307,16 +307,15 @@
my $encoding = lc($params{Encoding} || 'q');
### Encode any "words" with unsafe characters.
- ### We limit such words to 18 characters, to guarantee that the
+ ### We limit such words to 18 characters, to guarantee that the
### worst-case encoding give us no more than 54 + ~10 < 75 characters
my $word;
- $rawstr =~ s{([ a-zA-Z0-9\x7F-\xFF]{1,18})}{ ### get next "word"
+ $rawstr =~ s{([a-zA-Z0-9\x7F-\xFF]{1,18})}{ ### get next "word"
$word = $1;
- (($word !~ /(?:[$NONPRINT])|(?:^\s+$)/o)
+ (($word !~ /[$NONPRINT]/o)
? $word ### no unsafe chars
: encode_mimeword($word, $encoding, $charset)); ### has unsafe chars
}xeg;
- $rawstr =~ s/\?==\?/?= =?/g;
$rawstr;
}
@@ -348,3 +347,61 @@
its own module.
Stephane Barizien For reporting a nasty bug.
+
+=head1 VERSION
+
+$Revision: 1.14 $ $Date: 2006/03/17 21:03:23 $
+
+=cut
+
+
+#------------------------------
+# Execute simple test if run as a script.
+#------------------------------
+{
+ package main; no strict;
+ eval join('',<main::DATA>) || die "$@ $main::DATA" unless caller();
+}
+1; # end the module
+__END__
+
+
+### Pick up other MIME stuff, just in case...
+BEGIN { unshift @INC, ".", "./etc", "./lib" };
+import MIME::Words;
+
+my @encs = (
+ '=?US-ASCII?Q?Keith_Moore?= <moore@cs.utk.edu>',
+ '=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>',
+ '=?ISO-8859-1?Q?Andr=E9_?= Pirard <PIRARD@vm1.ulg.ac.be>',
+ ('=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?='.
+ '=?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?='.
+ '=?US-ASCII?Q?.._cool!?='));
+foreach $enc (@encs) {
+ $x = decode_mimewords($enc);
+ print "DEC: ", $x, "\n";
+}
+
+### Encode a single unsafe word:
+$encoded = encode_mimeword("\xABFran\xE7ois\xBB");
+print "ENC1: ", $encoded, "\n";
+
+### Encode a string, trying to find the unsafe words inside it:
+$encoded = encode_mimewords("Me and \xABFran\xE7ois\xBB at the beach");
+print "ENC2: ", $encoded, "\n";
+
+### Encode "<<Franc,ois>>":
+my $unsafe = <<EOF;
+Me and \xABFran\xE7ois\xBB, down at the beach
+with Dave <dave\@ether.net>
+EOF
+$encoded = encode_mimewords($unsafe);
+print "ENC3: ", $encoded, "\n";
+print "DEC3: ", scalar(decode_mimewords($encoded)), "\n";
+
+### So we know everything went well...
+exit 0;
+
+#------------------------------
+
+
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/t/Body.t
^
|
@@ -1,43 +1,53 @@
-#!/usr/bin/perl -w
+use lib "./t";
+
use strict;
-use warnings;
-use Test::More tests => 30;
+use ExtUtils::TBone;
use MIME::Body;
use MIME::Tools;
+config MIME::Tools DEBUGGING=>0;
-use Cwd;
+#------------------------------------------------------------
+# BEGIN
+#------------------------------------------------------------
+
+# Create checker:
+my $T = typical ExtUtils::TBone;
+$T->begin(2 * 9);
# Check bodies:
-my @bodies = (
- MIME::Body::Scalar->new(),
- MIME::Body::File->new('./testout/fbody'),
- MIME::Body::InCore->new(),
-);
+my $sbody = new MIME::Body::Scalar;
+my $ibody = new MIME::Body::InCore;
+my $fbody = new MIME::Body::File "./testout/fbody";
my $buf;
my @lines;
my $line;
+my $body;
my $pos;
-foreach my $body ( @bodies ) {
+foreach $body ($sbody, $fbody) {
my $io;
my $class = ref($body);
-# diag("Checking class: ", ref($body));
+ #------------------------------------------------------------
+ $T->msg("Checking class: ", ref($body));
+ #------------------------------------------------------------
# Open body for writing, and write stuff:
$io = $body->open("w");
- ok($io, "$class: opened for writing");
+ $T->ok($io,
+ "$class: opened for writing");
$io->print("Line 1\nLine 2\nLine 3");
$io->close;
# Open body for reading:
$io = $body->open("r");
- ok($io, "$class: able to open body for reading?");
+ $T->ok($io,
+ "$class: able to open body for reading?");
# Read all lines:
@lines = $io->getlines;
- ok((($lines[0] eq "Line 1\n") &&
+ $T->ok((($lines[0] eq "Line 1\n") &&
($lines[1] eq "Line 2\n") &&
($lines[2] eq "Line 3")),
"$class: getlines method works?"
@@ -46,22 +56,25 @@
# Seek forward, read:
$io->seek(3, 0);
$io->read($buf, 3);
- is($buf, 'e 1', "$class: seek(SEEK_START) plus read works?");
+ $T->ok(($buf eq 'e 1'),
+ "$class: seek(SEEK_START) plus read works?");
# Tell, seek, and read:
$pos = $io->tell;
$io->seek(-5, 1);
$pos = $io->tell;
- is($pos, 1, "$class: tell and seek(SEEK_CUR) works?");
+ $T->ok($pos == 1,
+ "$class: tell and seek(SEEK_CUR) works?");
$io->read($buf, 5);
- is($buf, 'ine 1', "$class: seek(SEEK_CUR) plus read works?");
+ $T->ok(($buf eq 'ine 1'),
+ "$class: seek(SEEK_CUR) plus read works?");
# Read all lines, one at a time:
@lines = ();
$io->seek(0, 0);
while ($line = $io->getline()) { push @lines, $line }
- ok((($lines[0] eq "Line 1\n") &&
+ $T->ok((($lines[0] eq "Line 1\n") &&
($lines[1] eq "Line 2\n") &&
($lines[2] eq "Line 3")),
"$class: getline works?"
@@ -73,7 +86,7 @@
# Slurp lines:
@lines = $body->as_lines;
- ok((($lines[0] eq "Line 1\n") &&
+ $T->ok((($lines[0] eq "Line 1\n") &&
($lines[1] eq "Line 2\n") &&
($lines[2] eq "Line 3")),
"$class: as_lines works?"
@@ -81,25 +94,12 @@
# Slurp string:
my $str = $body->as_string;
- is($str, "Line 1\nLine 2\nLine 3", "$class: as_string works?");
-}
-
-# Check that we can open files with leading whitespace in name
-# (RT ticket #22680)
-{
-
- my $cwd = cwd();
- ok( chdir './testout', 'chdir to ./testout to avoid clutter');
- eval {
- my $body = MIME::Body::File->new(" bad file ");
-
- my $fh = $body->open('w');
- $fh->close();
-
- ok( -e ' bad file ', 'file created with leading whitespace, as expected');
- unlink(' bad file ');
- };
- ok( chdir $cwd, 'chdir back');
+ $T->ok(($str eq "Line 1\nLine 2\nLine 3"),
+ "$class: as_string works?");
}
+# Done!
+$T->end;
+exit(0);
1;
+
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/t/Decoder.t
^
|
@@ -1,11 +1,11 @@
-#!/usr/bin/perl -w
-use strict;
-use warnings;
-use Test::More;
-use File::Spec;
+use lib "./t";
use MIME::Tools;
use MIME::Decoder;
+config MIME::Tools QUIET=>1;
+
+# config MIME::Tools DEBUGGING=>1;
+use ExtUtils::TBone;
#------------------------------------------------------------
# BEGIN
@@ -31,10 +31,12 @@
'x-uuencode',
'binhex');
-plan( tests => scalar @encodings);
+# Create checker:
+my $T = typical ExtUtils::TBone;
+$T->begin(scalar(@encodings));
# Report what tests we may be skipping:
-diag($has_gzip
+$T->msg($has_gzip
? "Using gzip: $has_gzip"
: "No gzip: skipping x-gzip64 test");
@@ -42,23 +44,17 @@
my ($e, $eno) = (undef, 0);
foreach $e (@encodings) {
++$eno;
- my $warning;
- local $SIG{__WARN__} = sub {
- $warning = $@;
- };
my $decoder = MIME::Decoder->new($e);
unless(defined($decoder)) {
- my $msg = "Encoding/decoding of $e not supported -- skipping test";
- if( $warning =~ /^Can't locate ([^\s]+)/ ) {
- $msg .= " (Can't locate $1)";
- }
- pass($msg);
+ $T->msg("Encoding/decoding of $e not supported -- skipping test");
+ $T->ok(1);
next;
}
- my $infile = File::Spec->catfile('.', 'testin', 'fun.txt');
- my $encfile = File::Spec->catfile('.', 'testout', "fun.en$eno");
- my $decfile = File::Spec->catfile('.', 'testout', "fun.de$eno");
+ $T->msg("Encoding/decoding of $e");
+ my $infile = $T->catfile('.', 'testin', 'fun.txt');
+ my $encfile = $T->catfile('.', 'testout', "fun.en$eno");
+ my $decfile = $T->catfile('.', 'testout', "fun.de$eno");
# Encode:
open IN, "<$infile" or die "open $infile: $!";
@@ -78,9 +74,15 @@
# Can we compare?
if ($e =~ /^(binhex|base64|quoted-printable|binary|x-gzip64|x-uuencode)$/i) {
- is(-s $infile, -s $decfile, "Encoding/decoding of $e: size of $infile == size of $decfile");
+ $T->ok(((-s $infile) == (-s $decfile)),
+ "size of $infile == size of $decfile");
}
else {
- pass("Encoding/decoding of $e: size not comparable, marking pass anyway");
+ $T->ok(1);
}
}
+
+# Done!
+$T->end;
+exit(0);
+1;
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/t/Entity.t
^
|
@@ -1,19 +1,27 @@
-#!/usr/bin/perl -w
-use strict;
-use warnings;
-use Test::More tests => 30;
+use lib "./t";
use MIME::Entity;
use MIME::Parser;
-
-use lib qw( ./t );
-use Globby; # TODO: WTF?
+use ExtUtils::TBone;
+use Globby;
+use strict;
my $line;
my $LINE;
-#diag("Testing build()");
+#------------------------------------------------------------
+# BEGIN
+#------------------------------------------------------------
+
+# Create checker:
+my $T = typical ExtUtils::TBone;
+$T->begin(30);
+
+
+#------------------------------------------------------------
+$T->msg("Testing build()");
+#------------------------------------------------------------
{local $SIG{__WARN__} = sub { die "caught warning: ",@_ };
{
my $e = MIME::Entity->build(Path => "./testin/short.txt");
@@ -22,26 +30,36 @@
#-----test------
$got = $e->head->mime_attr('content-type.name');
- is($got, $name, 'Path: with no Filename, got default content-type.name');
+ $T->ok($got eq $name,
+ "Path: with no Filename, got default content-type.name",
+ Got => $got);
#-----test------
$got = $e->head->mime_attr('content-disposition.filename');
- is($got, $name, 'Path: with no Filename, got default content-disp.filename');
+ $T->ok($got eq $name,
+ "Path: with no Filename, got default content-disp.filename",
+ Got => $got);
#-----test------
$got = $e->head->recommended_filename;
- is($got, $name, 'Path: with no Filename, got default recommended filename');
+ $T->ok($got eq $name,
+ "Path: with no Filename, got default recommended filename",
+ Got => $got);
}
{
#-----test------
my $e = MIME::Entity->build(Path => "./testin/short.txt",
Filename => undef);
my $got = $e->head->mime_attr('content-type.name');
- ok(!$got, 'Path: with explicitly undef Filename, got no filename');
+ $T->ok(!$got,
+ "Path: with explicitly undef Filename, got no filename",
+ Got => $got);
my $x = $e->stringify();
my $version = $MIME::Entity::VERSION;
my $desired = "Content-Type: text/plain\nContent-Disposition: inline\nContent-Transfer-Encoding: binary\nMIME-Version: 1.0\nX-Mailer: MIME-tools $version (Entity $version)\n\nDear «François Müller»,\n\nAs you requested, I have rewritten the MIME:: parser modules to support\nthe creation of MIME messages.\n\nEryq\n";
- is($x, $desired, 'Tested stringify');
+ $T->ok($x eq $desired,
+ "Tested stringify",
+ Got => $x);
}
{
@@ -49,35 +67,45 @@
my $e = MIME::Entity->build(Path => "./testin/short.txt",
Filename => "foo.txt");
my $got = $e->head->mime_attr('content-type.name');
- is($got, "foo.txt", "Path: verified explicit 'Filename'" );
+ $T->ok($got eq "foo.txt",
+ "Path: verified explicit 'Filename'",
+ Got => $got);
}
{
#-----test------
my $e = MIME::Entity->build(Path => "./testin/sig"
);
my $got = $e->head->mime_attr('content-type');
- is($got, 'text/plain', 'Type: default ok');
+ $T->ok($got eq 'text/plain',
+ "Type: default ok",
+ Got => $got);
}
{
#-----test------
my $e = MIME::Entity->build(Path => "./testin/sig",
Type => "text/foo");
my $got = $e->head->mime_attr('content-type');
- is($got, 'text/foo', 'Type: explicit ok');
+ $T->ok($got eq 'text/foo',
+ "Type: explicit ok",
+ Got => $got);
}
{
#-----test------
my $e = MIME::Entity->build(Path => "./testin/sig",
Encoding => '-SUGGEST');
my $got = $e->head->mime_attr('content-transfer-encoding');
- is($got, '7bit', 'Encoding: -SUGGEST yields 7bit');
+ $T->ok($got eq '7bit',
+ "Encoding: -SUGGEST yields 7bit",
+ Got => $got);
}
{
#-----test------
my $e = MIME::Entity->build(Path => "./testin/short.txt",
Encoding => '-SUGGEST');
my $got = $e->head->mime_attr('content-transfer-encoding');
- is($got, 'quoted-printable', 'Encoding: -SUGGEST yields qp');
+ $T->ok($got eq 'quoted-printable',
+ "Encoding: -SUGGEST yields qp",
+ Got => $got);
}
{
#-----test------
@@ -85,25 +113,33 @@
Path => "./testin/mime-sm.gif",
Encoding => '-SUGGEST');
my $got = $e->head->mime_attr('content-transfer-encoding');
- is($got, 'base64', 'Encoding: -SUGGEST yields base64');
+ $T->ok($got eq 'base64',
+ "Encoding: -SUGGEST yields base64",
+ Got => $got);
}
{
#-----test------
my $e = MIME::Entity->build(Path => "./testin/short.txt"
);
my $got = $e->head->mime_attr('content-type.charset');
- ok(!$got, 'Charset: default ok');
+ $T->ok(!$got,
+ "Charset: default ok",
+ Got => $got);
}
{
#-----test------
my $e = MIME::Entity->build(Path => "./testin/short.txt",
Charset => 'iso8859-1');
my $got = $e->head->mime_attr('content-type.charset');
- is($got, 'iso8859-1', 'Charset: explicit');
+ $T->ok($got eq 'iso8859-1',
+ "Charset: explicit",
+ Got => $got);
}
}
-#diag("Create an entity");
+#------------------------------------------------------------
+$T->msg("Create an entity");
+#------------------------------------------------------------
# Create the top-level, and set up the mail headers in a couple
# of different ways:
@@ -144,95 +180,128 @@
$attach = attach $top Data=>$LINE;
#-----test------
+$T->ok(1, "built a message");
unlink globby("testout/entity.msg*");
-#diag("Check body");
-
+#------------------------------------------------------------
+$T->msg("Check body");
+#------------------------------------------------------------
my $bodylines = $top->parts(0)->body;
-is( ref $bodylines, 'ARRAY', '->body returns an array reference');
-is( scalar @$bodylines, 6, '... of the correct size');
-
+#-----test------
+$T->ok($bodylines > 0,
+ "old-style body call ok");
my $preamble_str = join '', @{$top->preamble || []};
+my $preamble_len = length($preamble_str);
my $epilogue_str = join '', @{$top->epilogue || []};
+my $epilogue_len = length($epilogue_str);
-#diag("Output msg1 to explicit filehandle glob");
+#------------------------------------------------------------
+$T->msg("Output msg1 to explicit filehandle glob");
+#------------------------------------------------------------
open TMP, ">testout/entity.msg1" or die "open: $!";
$top->print(\*TMP);
close TMP;
#-----test------
-ok(-s "testout/entity.msg1",
+$T->ok((-s "testout/entity.msg1"),
"wrote msg1 to filehandle glob");
-#diag("Output msg2 to selected filehandle");
+#------------------------------------------------------------
+$T->msg("Output msg2 to selected filehandle");
+#------------------------------------------------------------
open TMP, ">testout/entity.msg2" or die "open: $!";
my $oldfh = select TMP;
$top->print;
select $oldfh;
close TMP;
#-----test------
-ok(-s "testout/entity.msg2",
+$T->ok((-s "testout/entity.msg2"),
"write msg2 to selected filehandle");
-#diag("Compare");
+#------------------------------------------------------------
+$T->msg("Compare");
+#------------------------------------------------------------
# Same?
-is(-s "testout/entity.msg1", -s "testout/entity.msg2",
+$T->ok(((-s "testout/entity.msg1") == (-s "testout/entity.msg2")),
"message files are same length");
-#diag("Parse it back in, to check syntax");
+#------------------------------------------------------------
+$T->msg("Parse it back in, to check syntax");
+#------------------------------------------------------------
my $parser = new MIME::Parser;
$parser->output_dir("testout");
open IN, "./testout/entity.msg1" or die "open: $!";
$top = $parser->parse(\*IN);
-#diag($parser->results->msgs);
+$T->msg($parser->results->msgs);
#-----test------
-ok($top, "parsed msg1 back in");
+$T->ok($top, "parsed msg1 back in");
my $preamble_str2 = join '', @{$top->preamble || []};
+my $preamble_len2 = length($preamble_str2);
my $epilogue_str2 = join '', @{$top->epilogue || []};
+my $epilogue_len2 = length($epilogue_str2);
#-----test------
-is($preamble_str, $preamble_str2, 'preamble strings match');
-
-#-----test------
-is($epilogue_str, $epilogue_str2, "epilogue strings match");
-
-#diag("Check the number of parts");
-is($top->parts, 4,
+$T->ok(($preamble_len == $preamble_len2),
+ "preambles match ($preamble_len == $preamble_len2)",
+ Pre1 => $preamble_str,
+ Pre2 => $preamble_str2,
+ );
+#-----test------
+$T->ok(($epilogue_len == $epilogue_len2),
+ "epilogues match ($epilogue_len == $epilogue_len2)",
+ Epi1 => $epilogue_str,
+ Epi2 => $epilogue_str2,
+ );
+
+#------------------------------------------------------------
+$T->msg("Check the number of parts");
+#------------------------------------------------------------
+$T->ok(($top->parts == 4),
"number of parts is correct (4)");
-#diag("Check attachment 1 [the GIF]");
+#------------------------------------------------------------
+$T->msg("Check attachment 1 [the GIF]");
+#------------------------------------------------------------
my $gif_real = (-s "./testin/mime-sm.gif");
my $gif_this = (-s "./testout/mime-sm.gif");
#-----test------
-is($gif_real, $gif_this,
+$T->ok(($gif_real == $gif_this),
"GIF is right size (real = $gif_real, this = $gif_this)");
my $part = ($top->parts)[1];
#-----test------
-is($part->head->mime_type, 'image/gif', "GIF has correct MIME type");
+$T->ok(($part->head->mime_type eq 'image/gif'),
+ "GIF has correct MIME type");
-#diag("Check attachment 3 [the short message]");
+#------------------------------------------------------------
+$T->msg("Check attachment 3 [the short message]");
+#------------------------------------------------------------
$part = ($top->parts)[3];
$io = $part->bodyhandle->open("r");
$line = ($io->getline);
$io->close;
#-----test------
-is($line, $LINE,
+$T->ok(($line eq $LINE),
"getline gets correct value (IO = $io, <$line>, <$LINE>)");
#-----test------
-is($part->head->mime_type, 'text/plain',
+$T->ok(($part->head->mime_type eq 'text/plain'),
"MIME type okay");
#-----test------
-is($part->head->mime_encoding, 'binary',
+$T->ok(($part->head->mime_encoding eq 'binary'),
"MIME encoding okay");
-#diag("Write it out, and compare");
+#------------------------------------------------------------
+$T->msg("Write it out, and compare");
+#------------------------------------------------------------
open TMP, ">testout/entity.msg3" or die "open: $!";
$top->print(\*TMP);
close TMP;
#-----test------
-is(-s 'testout/entity.msg2', -s 'testout/entity.msg3', 'msg2 same size as msg3');
+$T->ok(((-s "testout/entity.msg2") == (-s "testout/entity.msg3")),
+ "msg2 same size as msg3");
-#diag("Duplicate");
+#------------------------------------------------------------
+$T->msg("Duplicate");
+#------------------------------------------------------------
my $dup = $top->dup;
open TMP, ">testout/entity.dup3" or die "open: $!";
$dup->print(\*TMP);
@@ -240,25 +309,38 @@
my $msg3_s = -s "testout/entity.msg3";
my $dup3_s = -s "testout/entity.dup3";
#-----test------
-is($msg3_s, $dup3_s,
+$T->ok(($msg3_s == $dup3_s),
"msg3 size ($msg3_s) is same as dup3 size ($dup3_s)");
-#diag("Test signing");
+#------------------------------------------------------------
+$T->msg("Test signing");
+#------------------------------------------------------------
$top->sign(File=>"./testin/sig");
$top->remove_sig;
$top->sign(File=>"./testin/sig2", Remove=>56);
$top->sign(File=>"./testin/sig3");
-#diag("Write it out again, after synching");
+#------------------------------------------------------------
+$T->msg("Write it out again, after synching");
+#------------------------------------------------------------
$top->sync_headers(Nonstandard=>'ERASE',
Length=>'COMPUTE');
open TMP, ">testout/entity.msg4" or die "open: $!";
$top->print(\*TMP);
close TMP;
-#diag("Purge the files");
+#------------------------------------------------------------
+$T->msg("Purge the files");
+#------------------------------------------------------------
$top->purge;
#-----test------
-ok(!-e "./testout/mime-sm.gif", "purge worked");
+$T->ok((! -e "./testout/mime-sm.gif"),
+ "purge worked");
+# Done!
+exit(0);
1;
+
+
+
+
|
[-]
[+]
|
Added |
MIME-tools-5.420.tar.bz2/t/ExtUtils
^
|
+(directory)
|
[-]
[+]
|
Added |
MIME-tools-5.420.tar.bz2/t/ExtUtils/TBone.pm
^
|
@@ -0,0 +1,534 @@
+package ExtUtils::TBone;
+
+
+=head1 NAME
+
+ExtUtils::TBone - a "skeleton" for writing "t/*.t" test files.
+
+
+=head1 SYNOPSIS
+
+Include a copy of this module in your t directory (as t/ExtUtils/TBone.pm),
+and then write your t/*.t files like this:
+
+ use lib "./t"; # to pick up a ExtUtils::TBone
+ use ExtUtils::TBone;
+
+ # Make a tester... here are 3 different alternatives:
+ my $T = typical ExtUtils::TBone; # standard log
+ my $T = new ExtUtils::TBone; # no log
+ my $T = new ExtUtils::TBone "testout/Foo.tlog"; # explicit log
+
+ # Begin testing, and expect 3 tests in all:
+ $T->begin(3); # expect 3 tests
+ $T->msg("Something for the log file"); # message for the log
+
+ # Run some tests:
+ $T->ok($this); # test 1: no real info logged
+ $T->ok($that, # test 2: logs a comment
+ "Is that ok, or isn't it?");
+ $T->ok(($this eq $that), # test 3: logs comment + vars
+ "Do they match?",
+ This => $this,
+ That => $that);
+
+ # That last one could have also been written...
+ $T->ok_eq($this, $that); # does 'eq' and logs operands
+ $T->ok_eqnum($this, $that); # does '==' and logs operands
+
+ # End testing:
+ $T->end;
+
+
+=head1 DESCRIPTION
+
+This module is intended for folks who release CPAN modules with
+"t/*.t" tests. It makes it easy for you to output syntactically
+correct test-output while at the same time logging all test
+activity to a log file. Hopefully, bug reports which include
+the contents of this file will be easier for you to investigate.
+
+
+=head1 LOG FILE
+
+A typical log file output by this module looks like this:
+
+ 1..3
+
+ ** A message logged with msg().
+ ** Another one.
+ 1: My first test, using test(): how'd I do?
+ 1: ok 1
+
+ ** Yet another message.
+ 2: My second test, using test_eq()...
+ 2: A: The first string
+ 2: B: The second string
+ 2: not ok 2
+
+ 3: My third test.
+ 3: ok 3
+
+ END
+
+Each test() is logged with the test name and results, and
+the test-number prefixes each line.
+This allows you to scan a large file easily with "grep" (or, ahem, "perl").
+A blank line follows each test's record, for clarity.
+
+
+=head1 PUBLIC INTERFACE
+
+=cut
+
+# Globals:
+use strict;
+use vars qw($VERSION);
+use FileHandle;
+use File::Basename;
+
+# The package version, both in 1.23 style *and* usable by MakeMaker:
+$VERSION = substr q$Revision: 1.1 $, 10;
+
+
+
+#------------------------------
+
+=head2 Construction
+
+=over 4
+
+=cut
+
+#------------------------------
+
+=item new [ARGS...]
+
+I<Class method, constructor.>
+Create a new tester. Any arguments are sent to log_open().
+
+=cut
+
+sub new {
+ my $self = bless {
+ OUT =>\*STDOUT,
+ Begin=>0,
+ End =>0,
+ Count=>0,
+ }, shift;
+ $self->log_open(@_) if @_;
+ $self;
+}
+
+#------------------------------
+
+=item typical
+
+I<Class method, constructor.>
+Create a typical tester. Use this instead of new() for most applicaitons.
+The directory "testout" is created for you automatically, to hold
+the output log file.
+
+=cut
+
+sub typical {
+ my $class = shift;
+ my ($tfile) = basename $0;
+ unless (-d "testout") {
+ mkdir "testout", 0755
+ or die "Couldn't create a 'testout' subdirectory: $!\n";
+ ### warn "$class: created 'testout' directory\n";
+ }
+ $class->new($class->catfile('.', 'testout', "${tfile}log"));
+}
+
+#------------------------------
+# DESTROY
+#------------------------------
+# Class method, destructor.
+# Automatically closes the log.
+#
+sub DESTROY {
+ $_[0]->log_close;
+}
+
+
+#------------------------------
+
+=back
+
+=head2 Doing tests
+
+=over 4
+
+=cut
+
+#------------------------------
+
+=item begin NUMTESTS
+
+I<Instance method.>
+Start testing.
+
+=cut
+
+sub begin {
+ my ($self, $n) = @_;
+ return if $self->{Begin}++;
+ $self->l_print("1..$n\n\n");
+ print {$self->{OUT}} "1..$n\n";
+}
+
+#------------------------------
+
+=item end
+
+I<Instance method.>
+End testing.
+
+=cut
+
+sub end {
+ my ($self) = @_;
+ return if $self->{End}++;
+ $self->l_print("END\n");
+ print {$self->{OUT}} "END\n";
+}
+
+#------------------------------
+
+=item ok BOOL, [TESTNAME], [PARAMHASH...]
+
+I<Instance method.>
+Do a test, and log some information connected with it.
+Use it like this:
+
+ $T->ok(-e $dotforward);
+
+Or better yet, like this:
+
+ $T->ok((-e $dotforward),
+ "Does the user have a .forward file?");
+
+Or even better, like this:
+
+ $T->ok((-e $dotforward),
+ "Does the user have a .forward file?",
+ User => $ENV{USER},
+ Path => $dotforward,
+ Fwd => $ENV{FWD});
+
+That last one, if it were test #3, would be logged as:
+
+ 3: Does the user have a .forward file?
+ 3: User: "alice"
+ 3: Path: "/home/alice/.forward"
+ 3: Fwd: undef
+ 3: ok
+
+You get the idea. Note that defined quantities are logged with delimiters
+and with all nongraphical characters suitably escaped, so you can see
+evidence of unexpected whitespace and other badnasties.
+Had "Fwd" been the string "this\nand\nthat", you'd have seen:
+
+ 3: Fwd: "this\nand\nthat"
+
+And unblessed array refs like ["this", "and", "that"] are
+treated as multiple values:
+
+ 3: Fwd: "this"
+ 3: Fwd: "and"
+ 3: Fwd: "that"
+
+=cut
+
+sub ok {
+ my ($self, $ok, $test, @ps) = @_;
+ ++($self->{Count}); # next test
+
+ # Report to harness:
+ my $status = ($ok ? "ok " : "not ok ") . $self->{Count};
+ print {$self->{OUT}} $status, "\n";
+
+ # Log:
+ $self->ln_print($test, "\n") if $test;
+ while (@ps) {
+ my ($k, $v) = (shift @ps, shift @ps);
+ my @vs = ((ref($v) and (ref($v) eq 'ARRAY'))? @$v : ($v));
+ foreach (@vs) {
+ if (!defined($_)) { # value not defined: output keyword
+ $self->ln_print(qq{ $k: undef\n});
+ }
+ else { # value defined: output quoted, encoded form
+ s{([\n\t\x00-\x1F\x7F-\xFF\\\"])}
+ {'\\'.sprintf("%02X",ord($1)) }exg;
+ s{\\0A}{\\n}g;
+ $self->ln_print(qq{ $k: "$_"\n});
+ }
+ }
+ }
+ $self->ln_print($status, "\n");
+ $self->l_print("\n");
+ 1;
+}
+
+
+#------------------------------
+
+=item ok_eq ASTRING, BSTRING, [TESTNAME], [PARAMHASH...]
+
+I<Instance method.>
+Convenience front end to ok(): test whether C<ASTRING eq BSTRING>, and
+logs the operands as 'A' and 'B'.
+
+=cut
+
+sub ok_eq {
+ my ($self, $this, $that, $test, @ps) = @_;
+ $self->ok(($this eq $that),
+ ($test || "(Is 'A' string-equal to 'B'?)"),
+ A => $this,
+ B => $that,
+ @ps);
+}
+
+
+#------------------------------
+
+=item ok_eqnum ANUM, BNUM, [TESTNAME], [PARAMHASH...]
+
+I<Instance method.>
+Convenience front end to ok(): test whether C<ANUM == BNUM>, and
+logs the operands as 'A' and 'B'.
+
+=cut
+
+sub ok_eqnum {
+ my ($self, $this, $that, $test, @ps) = @_;
+ $self->ok(($this == $that),
+ ($test || "(Is 'A' numerically-equal to 'B'?)"),
+ A => $this,
+ B => $that,
+ @ps);
+}
+
+#------------------------------
+
+=back
+
+=head2 Logging messages
+
+=over 4
+
+=cut
+
+#------------------------------
+
+=item log_open PATH
+
+I<Instance method.>
+Open a log file for messages to be output to. This is invoked
+for you automatically by C<new(PATH)> and C<typical()>.
+
+=cut
+
+sub log_open {
+ my ($self, $path) = @_;
+ $self->{LogPath} = $path;
+ $self->{LOG} = FileHandle->new(">$path") || die "open $path: $!";
+ $self;
+}
+
+#------------------------------
+
+=item log_close
+
+I<Instance method.>
+Close the log file and stop logging.
+You shouldn't need to invoke this directly; the destructor does it.
+
+=cut
+
+sub log_close {
+ my $self = shift;
+ close(delete $self->{LOG}) if $self->{LOG};
+}
+
+#------------------------------
+
+=item log MESSAGE...
+
+I<Instance method.>
+Log a message to the log file. No alterations are made on the
+text of the message. See msg() for an alternative.
+
+=cut
+
+sub log {
+ my $self = shift;
+ print {$self->{LOG}} @_ if $self->{LOG};
+}
+
+#------------------------------
+
+=item msg MESSAGE...
+
+I<Instance method.>
+Log a message to the log file. Lines are prefixed with "** " for clarity,
+and a terminating newline is forced.
+
+=cut
+
+sub msg {
+ my $self = shift;
+ my $text = join '', @_;
+ chomp $text;
+ $text =~ s{^}{** }gm;
+ $self->l_print($text, "\n");
+}
+
+#------------------------------
+#
+# l_print MESSAGE...
+#
+# Instance method, private.
+# Print to the log file if there is one.
+#
+sub l_print {
+ my $self = shift;
+ print { $self->{LOG} } @_ if $self->{LOG};
+}
+
+#------------------------------
+#
+# ln_print MESSAGE...
+#
+# Instance method, private.
+# Print to the log file, prefixed by message number.
+#
+sub ln_print {
+ my $self = shift;
+ foreach (split /\n/, join('', @_)) {
+ $self->l_print("$self->{Count}: $_\n");
+ }
+}
+
+#------------------------------
+
+=back
+
+=head2 Utilities
+
+=over 4
+
+=cut
+
+#------------------------------
+
+=item catdir DIR, ..., DIR
+
+I<Class/instance method.>
+Concatenate several directories into a path ending in a directory.
+Lightweight version of the one in the (very new) File::Spec.
+
+Paths are assumed to be absolute.
+To signify a relative path, the first DIR must be ".",
+which is processed specially.
+
+On Mac, the path I<does> end in a ':'.
+On Unix, the path I<does not> end in a '/'.
+
+=cut
+
+sub catdir {
+ my $self = shift;
+ my $relative = shift @_ if ($_[0] eq '.');
+ if ($^O eq 'Mac') {
+ return ($relative ? ':' : '') . (join ':', @_) . ':';
+ }
+ else {
+ return ($relative ? './' : '/') . join '/', @_;
+ }
+}
+
+#------------------------------
+
+=item catfile DIR, ..., DIR, FILE
+
+I<Class/instance method.>
+Like catdir(), but last element is assumed to be a file.
+Note that, at a minimum, you must supply at least a single DIR.
+
+=cut
+
+sub catfile {
+ my $self = shift;
+ my $file = pop;
+ if ($^O eq 'Mac') {
+ return $self->catdir(@_) . $file;
+ }
+ else {
+ return $self->catdir(@_) . "/$file";
+ }
+}
+
+#------------------------------
+
+=back
+
+
+=head1 CHANGE LOG
+
+B<Current version:>
+$Id: TBone.pm,v 1.1 2004/09/03 14:44:37 dfs Exp $
+
+=over 4
+
+=item Version 1.116
+
+Cosmetic improvements only.
+
+
+=item Version 1.112
+
+Added lightweight catdir() and catfile() (a la File::Spec)
+to enhance portability to Mac environment.
+
+
+=item Version 1.111
+
+Now uses File::Basename to create "typical" logfile name,
+for portability.
+
+
+=item Version 1.110
+
+Fixed bug in constructor that surfaced if no log was being used.
+
+=back
+
+Created: Friday-the-13th of February, 1998.
+
+
+=head1 AUTHOR
+
+Eryq (F<eryq@zeegee.com>).
+President, ZeeGee Software Inc. (F<http://www.zeegee.com>)
+
+=cut
+
+#------------------------------
+
+1;
+__END__
+
+my $T = new ExtUtils::TBone "testout/foo.tlog";
+$T->begin(3);
+$T->msg("before 1\nor 2");
+$T->ok(1, "one");
+$T->ok(2, "Two");
+$T->ok(3, "Three", Roman=>'III', Arabic=>[3, '03'], Misc=>"3\nor 3");
+$T->end;
+
+1;
+
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/t/Gauntlet.t
^
|
@@ -1,9 +1,11 @@
-#!/usr/bin/perl -w
-use strict;
-use warnings;
-use Test::More tests => 63;
+use lib "./t";
+
use MIME::Parser;
+use strict;
+config MIME::Tools DEBUGGING=>0;
+use ExtUtils::TBone;
+
# Are on a machine where binmode matters?
my $txtmode = "./testout/textmode";
@@ -17,6 +19,9 @@
my $MSGLINES = 20;
my $MSGLEN_text = $MSGLEN + ($uses_crlf * $MSGLINES);
+# Checker:
+my $T = typical ExtUtils::TBone;
+
# Gout...
sub gout {
my ($h, $ent) = @_;
@@ -31,41 +36,43 @@
$pos1 = tell($sh);
eval { $ent->print($h) };
$pos2 = tell($sh);
- ok((!$@ and (($pos2 - $pos1) == $MSGLEN_text)),
+ $T->ok((!$@ and (($pos2 - $pos1) == $MSGLEN_text)),
"$h, $test [$pos1-$pos2 == $MSGLEN_text]");
print $sh "\n", "=" x 30, " ", ($test = "print ent->as_string"), "\n";
$pos1 = tell($sh);
eval { print $h $ent->as_string };
$pos2 = tell($sh);
- ok((!$@ and (($pos2 - $pos1) == $MSGLEN_text)),
+ $T->ok((!$@ and (($pos2 - $pos1) == $MSGLEN_text)),
"$h, $test [$pos1-$pos2]");
print $sh "\n", "=" x 30, " ", ($test = "ent->print_header"), "\n";
eval { $ent->print_header($h) };
- ok(!$@, "$h, $test: $@");
+ $T->ok(!$@, "$h, $test: $@");
print $sh "\n", "=" x 30, " ", ($test = "ent->print_body"), "\n";
eval { $ent->print_body($h) };
- ok(!$@, "$h, $test: $@");
+ $T->ok(!$@, "$h, $test: $@");
print $sh "\n", "=" x 30, " ", ($test = "ent->bodyhandle->print"), "\n";
eval { $ent->bodyhandle->print($h) };
- ok(!$@, "$h, $test: $@");
+ $T->ok(!$@, "$h, $test: $@");
print $sh "\n", "=" x 30, " ",($test = "print ent->bodyhandle->data"),"\n";
eval { print $h $ent->bodyhandle->data };
- ok(!$@, "$h, $test: $@");
+ $T->ok(!$@, "$h, $test: $@");
1;
}
# Loops:
-# When adjusting these, make sure to increment test count. Should be:
-# 21 * scalar @corelims * scalar @msgfiles
my @msgfiles = qw(simple.msg);
my @corelims = qw(ALL NONE 512);
+
+# Create checker:
+$T->begin(((6+1) * 3 * int(@corelims) * int(@msgfiles)));
+
# Create a parser:
my $parser = new MIME::Parser;
$parser->output_dir("./testout");
@@ -90,22 +97,26 @@
gout('::GOUT', $ent);
close GOUT;
my $s1 = -s $out;
- is($s1, $outsize, "BARE FH: size $out ($s1) == $outsize?");
+ $T->ok($s1 == $outsize, "BARE FH: size $out ($s1) == $outsize?");
# Open output stream 2:
open GOUT, ">$out" or die "$!";
gout(\*GOUT, $ent);
close GOUT;
my $s2 = -s $out;
- is($s2, $outsize, "GLOB ref: size $out ($s2) == $outsize?");
+ $T->ok($s2 == $outsize, "GLOB ref: size $out ($s2) == $outsize?");
# Open output stream 3:
- my $GOUT = IO::File->new($out, '>') || die "$!";
+ my $GOUT = (new FileHandle ">$out") || die "$!";
gout($GOUT, $ent);
$GOUT->close;
my $s3 = -s $out;
- is($s3, $outsize, "IO::File: size $out ($s3) == $outsize?");
+ $T->ok($s3 == $outsize, "FileHandle: size $out ($s3) == $outsize?");
}
}
+
+# Done!
+exit(0);
1;
+
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/t/Head.t
^
|
@@ -1,29 +1,33 @@
-#!/usr/bin/perl -w
-use strict;
-use warnings;
-use Test::More tests => 20;
-
+use lib "./t";
use MIME::Head;
+use ExtUtils::TBone;
+
+#------------------------------------------------------------
+# BEGIN
+#------------------------------------------------------------
+
+# Create checker:
+my $T = typical ExtUtils::TBone;
+$T->begin(17);
#------------------------------------------------------------
-##diag("Read a bogus file (this had better fail...)");
+$T->msg("Read a bogus file (this had better fail...)");
#------------------------------------------------------------
my $WARNS = $SIG{'__WARN__'}; $SIG{'__WARN__'} = sub { };
my $head = MIME::Head->from_file('BLAHBLAH');
-ok(!$head, "parse failed as expected?");
+$T->ok(!$head, "parse failed as expected?");
$SIG{'__WARN__'} = $WARNS;
#------------------------------------------------------------
-##diag("Parse in the crlf.hdr file:");
+$T->msg("Parse in the crlf.hdr file:");
#------------------------------------------------------------
-# TODO: use lives_ok from Test::Exception ?
($head = MIME::Head->from_file('./testin/crlf.hdr'))
or die "couldn't parse input"; # stop now
-ok('HERE',
+$T->ok('HERE',
"parse of good file succeeded as expected?");
#------------------------------------------------------------
-##diag("Did we get all the fields?");
+$T->msg("Did we get all the fields?");
#------------------------------------------------------------
my @actuals = qw(path
from
@@ -43,54 +47,61 @@
push(@actuals, "From ");
my $actual = join '|', sort( map {lc($_)} @actuals);
my $parsed = join '|', sort( map {lc($_)} $head->tags);
-is($parsed, $actual, 'got all fields we expected?');
+$T->ok($parsed eq $actual,
+ "got all fields we expected?");
#------------------------------------------------------------
-##diag("Could we get() the 'subject'? (it'll end in \\r\\n)");
+$T->msg("Could we get() the 'subject'? (it'll end in \\r\\n)");
#------------------------------------------------------------
my $subject;
($subject) = ($head->get('subject',0)); # force array context, see if okay
-is($subject, "EMPLOYMENT: CHICAGO, IL UNIX/CGI/WEB/DBASE\r\n", "got the subject okay?" );
+$T->ok($subject eq "EMPLOYMENT: CHICAGO, IL UNIX/CGI/WEB/DBASE\r\n",
+ "got the subject okay?",
+ Subject => $subject);
#------------------------------------------------------------
-##diag("Could we replace() the 'Subject', and get it as 'SUBJECT'?");
+$T->msg("Could we replace() the 'Subject', and get it as 'SUBJECT'?");
#------------------------------------------------------------
my $newsubject = "Hellooooooo, nurse!\r\n";
$head->replace('Subject', $newsubject);
$subject = $head->get('SUBJECT');
-is($subject, $newsubject, 'able to set Subject, and get SUBJECT?');
+$T->ok($subject eq $newsubject,
+ "able to set Subject, and get SUBJECT?");
#------------------------------------------------------------
-##diag("Does the count() method work?");
+$T->msg("Does the count() method work?");
#------------------------------------------------------------
-ok($head->count('NNTP-Posting-Host')
- && $head->count('nntp-POSTING-HOST')
- && !$head->count('Doesnt-Exist'), 'count method working?');
+$T->ok($head->count('NNTP-Posting-Host') and
+ $head->count('nntp-POSTING-HOST') and
+ !($head->count('Doesnt-Exist')),
+ "count method working?");
#------------------------------------------------------------
-##diag("Create a custom structured field, and extract parameters");
+$T->msg("Create a custom structured field, and extract parameters");
#------------------------------------------------------------
$head->replace('X-Files',
'default ; name="X Files Test"; LENgth=60 ;setting="6"');
my $params;
-$params = $head->params('X-Files');
-ok($params, "got the parameter hash?");
-is($params->{_} , 'default', "got the default field?");
-is($params->{'name'} , 'X Files Test', "got the name?");
-is($params->{'length'} , '60', "got the length?");
-is($params->{'setting'}, '6', "got the setting?");
+{ local $^W = 0;
+ $params = $head->params('X-Files');
+}
+$T->ok($params, "got the parameter hash?");
+$T->ok($$params{_} eq 'default', "got the default field?");
+$T->ok($$params{'name'} eq 'X Files Test', "got the name?");
+$T->ok($$params{'length'} eq '60', "got the length?");
+$T->ok($$params{'setting'} eq '6', "got the setting?");
#------------------------------------------------------------
-##diag("Output to a desired file");
+$T->msg("Output to a desired file");
#------------------------------------------------------------
open TMP, ">./testout/tmp.head" or die "open: $!";
$head->print(\*TMP);
close TMP;
-ok((-s "./testout/tmp.head") > 50,
+$T->ok((-s "./testout/tmp.head") > 50,
"output is a decent size?"); # looks okay
#------------------------------------------------------------
-##diag("Parse in international header, decode and unfold it");
+$T->msg("Parse in international header, decode and unfold it");
#------------------------------------------------------------
($head = MIME::Head->from_file('./testin/encoded.hdr'))
or die "couldn't parse input"; # stop now
@@ -100,11 +111,11 @@
my $to = $head->get('to',0); $to =~ s/\r?\n\Z//;
my $tsubject = "If you can read this you understand the example... cool!";
my $tto = "Keld J\370rn Simonsen <keld\@dkuug.dk>";
-is($to, $tto, "Q decoding okay?");
-is($subject, $tsubject, "B encoding and compositing okay?");
+$T->ok($to eq $tto, "Q decoding okay?");
+$T->ok($subject eq $tsubject, "B encoding and compositing okay?");
#------------------------------------------------------------
-##diag("Parse in header with 'From ', and check field order");
+$T->msg("Parse in header with 'From ', and check field order");
#------------------------------------------------------------
# Prep:
@@ -131,7 +142,7 @@
# Does it work?
@orighdrs = map {/^\S+:?/ ? $& : ''} (split(/\r?\n/, $head->stringify));
@curhdrs = @realhdrs;
-is(lc(join('|',@orighdrs)), lc(join('|',@curhdrs)),
+$T->ok(lc(join('|',@orighdrs)) eq lc(join('|',@curhdrs)),
"field order preserved under stringify?");
# Does it work if we add/replace fields?
@@ -139,27 +150,18 @@
$head->replace("Subject", "Hi there again!");
@curhdrs = (@realhdrs, "X-New-Addition:");
@orighdrs = map {/^\S+:?/ ? $& : ''} (split(/\r?\n/, $head->stringify));
-is(lc(join('|',@orighdrs)), lc(join('|',@curhdrs)),
+$T->ok(lc(join('|',@orighdrs)) eq lc(join('|',@curhdrs)),
"field order preserved under stringify after fields added?");
# Does it work if we decode the header?
$head->decode;
@orighdrs = map {/^\S+:?/ ? $& : ''} (split(/\r?\n/, $head->stringify));
-is(lc(join('|',@orighdrs)), lc(join('|',@curhdrs)),
+$T->ok(lc(join('|',@orighdrs)) eq lc(join('|',@curhdrs)),
"field order is preserved under stringify after decoding?");
-{
- my $h = MIME::Head->new();
+# Done!
+exit(0);
+1;
- $h->replace('Content-disposition', 'inline; filename=good.file');
- is($h->recommended_filename(), 'good.file', 'Simple case, good filename');
- $h->replace('Content-disposition', 'inline; filename=" "');
- $h->replace('Content-type', 'text/x-fake; name="second.choice"');
- is($h->recommended_filename(), 'second.choice', 'Simple case, second-best choice of filename');
- $h->replace('Content-type', 'text/x-fake; name=" "');
- is($h->recommended_filename(), undef, 'no filenames found');
-}
-
-1;
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/t/Misc.t
^
|
@@ -1,13 +1,12 @@
-#!/usr/bin/perl -w
-use strict;
-use warnings;
-use Test::More tests => 14;
-
+use lib "./t";
use MIME::Head;
use MIME::Parser;
-use Mail::Field;
-use MIME::Head;
-use MIME::Decoder::QuotedPrint;
+
+use ExtUtils::TBone;
+
+# Create checker:
+my $T = typical ExtUtils::TBone;
+$T->begin(14);
#------------------------------
# Bug 971008 from Michael W. Normandin <michael.normandin@csfb.com>:
@@ -26,7 +25,7 @@
my $head = MIME::Head->new([
'Content-Type: application/vnd.ms-powerpoint; name="June97V4.0.ppt"'
]);
- is($head->mime_type,
+ $T->ok_eq($head->mime_type,
"application/vnd.ms-powerpoint",
"bug 971008-MWN: are MIME attributes parsed ok?");
}
@@ -48,12 +47,14 @@
# than `Mail::Field', but I am at a loss as to what to do next. Maybe you
# can help? Thank you very much.
{
+ use Mail::Field;
+ use MIME::Head;
my $field = Mail::Field->new('Content-type',
'text/HTML; charset="US-ASCII"');
- is($field->paramstr('_'),
+ $T->ok_eq($field->paramstr('_'),
"text/HTML",
"bug 970822-AL: Mail::Field register problem (paramstr)");
- is($field->type,
+ $T->ok_eq($field->type,
"text/html",
"bug 970822-AL: Mail::Field register problem (type)");
}
@@ -69,25 +70,27 @@
#
# Textual mode.
{
+ use MIME::Decoder::QuotedPrint;
my $pair;
foreach $pair (["From me", "=46rom me=\n"],
[".", ".=\n"], # soft line-break
[".\n", "=2E\n"], # line-break
[" From you", " From you=\n"]) {
my $out = MIME::Decoder::QuotedPrint::encode_qp_really($pair->[0], 1);
- is($out, $pair->[1],
+ $T->ok_eq($out, $pair->[1],
"bug 970725-DNA: QP use of RFC2049 guideline 8");
}
}
# Binary mode
{
+ use MIME::Decoder::QuotedPrint;
my $pair;
foreach $pair (["From me", "=46rom me=\n"],
[".", ".=\n"], # soft line-break
[".\n", ".=0A=\n"], # line-break
[" From you", " From you=\n"]) {
my $out = MIME::Decoder::QuotedPrint::encode_qp_really($pair->[0], 0);
- is($out, $pair->[1],
+ $T->ok_eq($out, $pair->[1],
"bug 970725-DNA: QP use of RFC2049 guideline 8");
}
}
@@ -107,7 +110,7 @@
"Received: fourth\n",
"subject: hi!\n"]);
my @received = $head->get_all('Received');
- is(scalar @received,
+ $T->ok_eqnum(int(@received),
4,
"bug 970626-TS: header get_all() case problem fixed?");
}
@@ -120,7 +123,7 @@
my $parser = new MIME::Parser;
$parser->output_to_core('ALL');
my $e = eval { $parser->parse_open("testin/jt-0498.msg") };
- is(scalar $e->parts,
+ $T->ok_eqnum(($e and scalar $e->parts),
2,
"bug 980430-JT: did we get 2 parts?");
}
@@ -130,9 +133,13 @@
my $parser = new MIME::Parser;
$parser->output_to_core('ALL');
my $e = eval { $parser->parse_open("testin/twopart.msg") };
- is( scalar $e->parts,
+ $T->ok_eqnum(($e and scalar $e->parts),
2,
"bug: did we get 2 parts?");
}
+#------------------------------------------------------------
+$T->end;
1;
+
+
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/t/Parser.t
^
|
@@ -1,18 +1,23 @@
-#!/usr/bin/perl -w
-use strict;
-use warnings;
-use Test::More tests => 31;
-
+use lib "./t";
use MIME::Tools;
-use lib "./t";
+use ExtUtils::TBone;
use Globby;
+use strict;
+config MIME::Tools DEBUGGING=>0;
+
use MIME::Parser;
+#------------------------------------------------------------
+
# Set the counter, for filenames:
my $Counter = 0;
+# Create checker:
+my $T = typical ExtUtils::TBone;
+$T->begin(12);
+
# Check and clear the output directory:
my $DIR = "./testout";
((-d $DIR) && (-w $DIR)) or die "no output directory $DIR";
@@ -32,6 +37,14 @@
#------------------------------------------------------------
+$T->msg("Create a parser");
+#------------------------------------------------------------
+
+
+
+
+
+#------------------------------------------------------------
package MyParser;
@MyParser::ISA = qw(MIME::Parser);
sub output_path {
@@ -40,7 +53,7 @@
# Get the recommended filename:
my $filename = $head->recommended_filename;
if (defined($filename) && $parser->evil_filename($filename)) {
-## diag("Parser.t: ignoring an evil recommended filename ($filename)");
+ $T->msg("Parser.t: ignoring an evil recommended filename ($filename)");
$filename = undef; # forget it: it was evil
}
if (!defined($filename)) { # either no name or an evil name
@@ -60,32 +73,34 @@
$parser->output_dir($DIR);
#------------------------------------------------------------
-##diag("Read a nested multipart MIME message");
+$T->msg("Read a nested multipart MIME message");
#------------------------------------------------------------
open IN, "./testmsgs/multi-nested.msg" or die "open: $!";
$entity = $parser->parse(\*IN);
-ok($entity, "parse of nested multipart");
+$T->ok($entity, "parse of nested multipart");
#------------------------------------------------------------
-##diag("Check the various output files");
+$T->msg("Check the various output files");
#------------------------------------------------------------
-is(-s "$DIR/3d-vise.gif", 419, "vise gif size ok");
-is(-s "$DIR/3d-eye.gif" , 357, "3d-eye gif size ok");
+$T->ok((-s "$DIR/3d-vise.gif" == 419), "vise gif");
+$T->ok((-s "$DIR/3d-eye.gif" == 357) , "3d-eye gif");
for $msgno (1..4) {
- ok(-s "$DIR/message-$msgno.dat", "message $msgno has a size");
+ $T->ok((-s "$DIR/message-$msgno.dat"), "message $msgno");
}
#------------------------------------------------------------
-##diag("Same message, but CRLF-terminated and no output path hook");
+$T->msg("Same message, but CRLF-terminated and no output path hook");
#------------------------------------------------------------
$parser = new MIME::Parser;
+{ local $^W = undef;
$parser->output_dir($DIR);
open IN, "./testmsgs/multi-nested2.msg" or die "open: $!";
$entity = $parser->parse(\*IN);
-ok($entity, "parse of CRLF-terminated message");
+$T->ok($entity, "parse of CRLF-terminated message");
+}
#------------------------------------------------------------
-##diag("Read a simple in-core MIME message, three ways");
+$T->msg("Read a simple in-core MIME message, three ways");
#------------------------------------------------------------
my $data_scalar = <<EOF;
Content-type: text/html
@@ -95,84 +110,25 @@
EOF
my $data_scalarref = \$data_scalar;
my $data_arrayref = [ map { "$_\n" } (split "\n", $data_scalar) ];
+my $data_test;
$parser->output_to_core('ALL');
-foreach my $data_test ($data_scalar, $data_scalarref, $data_arrayref) {
+foreach $data_test ($data_scalar, $data_scalarref, $data_arrayref) {
$entity = $parser->parse_data($data_test);
- isa_ok($entity, 'MIME::Entity');
- is($entity->head->mime_type, 'text/html', 'type is text/html');
+ $T->ok(($entity and $entity->head->mime_type eq 'text/html') ,
+ ((ref($data_test)||'NO') . "-REF"));
}
$parser->output_to_core('NONE');
#------------------------------------------------------------
-##diag("Simple message, in two parts");
+$T->msg("Simple message, in two parts");
#------------------------------------------------------------
$entity = $parser->parse_two("./testin/simple.msgh", "./testin/simple.msgb");
my $es = ($entity ? $entity->head->get('subject',0) : '');
-like($es, qr/^Request for Leave$/, " parse of 2-part simple message (subj <$es>)");
-
-
-# diag('new_tmpfile(), with real temp file');
-{
- my $fh;
- eval {
- local $parser->{MP5_TmpToCore} = 0;
- $fh = $parser->new_tmpfile();
- };
- ok( ! $@, '->new_tmpfile() lives');
- ok( $fh->print("testing\n"), '->print on fh ok');
-
- ok( $fh->seek(0,0), '->seek on fh ok');
- my $line = <$fh>;
- is( $line, "testing\n", 'Read line back in OK');
-}
-
-# diag('new_tmpfile(), with in-core temp file');
-{
- my $fh;
- eval {
- local $parser->{MP5_TmpToCore} = 1;
- $fh = $parser->new_tmpfile();
- };
- ok( ! $@, '->new_tmpfile() lives');
- ok( $fh->print("testing\n"), '->print on fh ok');
-
- ok( $fh->seek(0,0), '->seek on fh ok');
- my $line = <$fh>;
- is( $line, "testing\n", 'Read line back in OK');
-}
+$T->ok(($es =~ /^Request for Leave$/),
+ " parse of 2-part simple message (subj <$es>)");
-# diag('new_tmpfile(), with temp files elsewhere');
-{
- my $fh;
- eval {
- local $parser->{MP5_TmpDir} = $DIR;
- $fh = $parser->new_tmpfile();
- };
- ok( ! $@, '->new_tmpfile() lives');
- ok( $fh->print("testing\n"), '->print on fh ok');
-
- ok( $fh->seek(0,0), '->seek on fh ok');
- my $line = <$fh>;
- is( $line, "testing\n", 'Read line back in OK');
-}
-
-# diag('native_handle() on various things we might get');
-{
- my $io_file_scalar = IO::File->new( do { my $foo = ''; \$foo }, '>:' );
- ok( MIME::Parser::Reader::native_handle( $io_file_scalar ), 'FH on scalar is OK');
-
- my $io_file_real = IO::File->new_tmpfile();
- ok( MIME::Parser::Reader::native_handle( $io_file_real ), 'FH on real file is OK');
-
- my $globref = \*STDOUT;
- ok( MIME::Parser::Reader::native_handle( $globref ), 'globref is OK');
-
-}
-
-# diag('tmp_recycling() exists again, as a no-op');
-{
- my $rc = $parser->tmp_recycling(1);
- is( $rc, undef, 'tmp_recycling no-op method returned undef');
-}
+# Done!
+exit(0);
+1;
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/t/ParserEncoded.t
^
|
@@ -1,7 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
use strict;
-use warnings;
use Test::More;
plan tests => 5;
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/t/ParserPreamble.t
^
|
@@ -1,7 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
use strict;
-use warnings;
use Test::More;
plan tests => 2;
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/t/Ref.t
^
|
@@ -1,36 +1,35 @@
-#!/usr/bin/perl -w
-use strict;
-use warnings;
-
-use Test::More;
+use lib "./t";
use MIME::Tools;
use File::Path;
-use File::Spec;
use File::Basename;
+use ExtUtils::TBone;
+use Globby;
use MIME::WordDecoder qw(unmime);
-use lib qw( ./t/ );
-use Globby;
+use strict;
+config MIME::Tools DEBUGGING=>0;
use MIME::Parser;
+my $T = typical ExtUtils::TBone;
#print STDERR "\n";
### Verify directory paths:
(-d "testout") or die "missing testout directory\n";
-my $output_dir = File::Spec->catdir(".", "testout", "Ref_t");
+my $output_dir = $T->catdir(".", "testout", "Ref_t");
### Get messages to process:
my @refpaths = @ARGV;
if (!@refpaths) {
opendir DIR, "testmsgs" or die "opendir: $!\n";
- @refpaths = map { File::Spec->catfile(".", "testmsgs", $_)
+ @refpaths = map { $T->catfile(".", "testmsgs", $_)
} grep /\w.*\.ref$/, readdir(DIR);
closedir DIR;
}
-plan( tests => 2 * scalar(@refpaths) );
+### Create checker:
+$T->begin(2 * int(@refpaths));
### For each reference:
foreach my $refpath (@refpaths) {
@@ -42,9 +41,9 @@
### Get reference, as ref to array:
my $ref = read_ref($refpath);
if ($ref->{Parser}{Message}) {
- $msgpath = File::Spec->catfile(".", (split /\//, $ref->{Parser}{Message}));
+ $msgpath = $T->catfile(".", (split /\//, $ref->{Parser}{Message}));
}
- # diag("Trying $refpath [$msgpath]\n");
+ $T->log("Trying $refpath [$msgpath]\n");
### Create parser which outputs to testout/scratch:
my $parser = MIME::Parser->new;
@@ -65,7 +64,7 @@
'US-ASCII' => 'KEEP',
'*' => 'WARN']);
}
- # diag("Default charset: $tgt");
+ $T->log("Default charset: $tgt");
MIME::WordDecoder->default($wd);
### Pre-clean:
@@ -77,25 +76,27 @@
my $parse_error = $@;
### Output parse log:
-# diag("PARSE LOG FOR $refpath [$msgpath]");
+ $T->msg("PARSE LOG FOR $refpath [$msgpath]");
if ($parser->results) {
-# diag($parser->results->msgs);
+ $T->msg($parser->results->msgs);
}
else {
- diag("Parse failed before results object was created");
+ $T->msg("Parse failed before results object was created");
}
### Interpret results:
if ($parse_error || !$ent) {
- ok($ref->{Msg}{Fail}, "$refpath, problem: $parse_error" );
+ $T->ok($ref->{Msg}{Fail},
+ $refpath,
+ Problem => $parse_error);
}
else {
- # TODO: check_ref is evil
my $ok = eval { check_ref($msgpath, $ent, $ref) };
- if( $@ ) {
- diag("Eval failed: $@");
- }
- ok($ok, "$refpath Message => $msgpath, Parser => " . ($ref->{Parser}{Name} || 'default'));
+ $T->ok($ok,
+ $refpath,
+ ($@ ? (Error => $@) : ()),
+ Message => $msgpath,
+ Parser => ($ref->{Parser}{Name} || 'default'));
}
### Is purge working?
@@ -103,7 +104,12 @@
my @p_files = $parser->filer->purgeable;
$parser->filer->purge;
my @z_files = list_dir($output_dir);
- is(@z_files, 0, 'Did purge work?');
+ $T->ok((@z_files == 0),
+ "Did purge work?",
+ Purgeable => \@p_files,
+ Original => \@a_files,
+ Remaining => \@z_files
+ );
### Cleanup for real:
rmtree($output_dir);
@@ -144,7 +150,7 @@
}
#------------------------------
-# TODO: replace with cmp_deeply from Test::Deep?
+
sub check_ref {
my ($msgpath, $ent, $ref) = @_;
@@ -208,9 +214,9 @@
}
elsif (/^Size$/) {
if ($head->mime_type =~ m{^(text|message)}) {
-# diag("Skipping Size evaluation in text message ".
-# "due to variations in local newline ".
-# "conventions\n\n");
+ $T->log("Skipping Size evaluation in text message ".
+ "due to variations in local newline ".
+ "conventions\n\n");
next ATTR;
}
if ($body and $body->path) { $got = (-s $body->path) }
@@ -220,10 +226,10 @@
}
### Log this sub-test:
-# diag("SUB-TEST: msg=$msgpath; part=$partname; attr=$_:\n");
-# diag(" want: ".encode($want)."\n");
-# diag(" got: ".encode($got )."\n");
-# diag("\n");
+ $T->log("SUB-TEST: msg=$msgpath; part=$partname; attr=$_:\n");
+ $T->log(" want: ".encode($want)."\n");
+ $T->log(" got: ".encode($got )."\n");
+ $T->log("\n");
next ATTR if (!defined($want) and !defined($got));
next ATTR if ($want eq $got);
|
[-]
[+]
|
Added |
MIME-tools-5.420.tar.bz2/t/Tmpfile.topt
^
|
@@ -0,0 +1,32 @@
+use lib "./t";
+use MIME::Tools qw(tmpopen);
+use ExtUtils::TBone;
+use FileHandle;
+
+# Create checker:
+my $ntests = 800;
+my $T = typical ExtUtils::TBone;
+$T->begin($ntests);
+
+# Run the test:
+my $i;
+for ($i = 0; $i < $ntests; $i++) {
+### print STDERR "+";
+ STDERR->flush;
+ leak();
+}
+
+# leak
+sub leak {
+ my $TMP = (tmpopen() || die "tmpopen: $!");
+ print $TMP "Hello!\nGoodbye!\n";
+ seek($TMP, 0, 0);
+ my $line = <$TMP>;
+ $T->ok($line, "Hello!\n");
+ # no close! hopefully, the destructor will handle it!
+}
+
+
+
+
+1;
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/t/WordDecoder.t
^
|
@@ -1,11 +1,19 @@
-#!/usr/bin/perl -w
+use lib "./t";
+
use strict;
-use warnings;
-use Test::More tests => 18;
+use ExtUtils::TBone;
use MIME::QuotedPrint qw(decode_qp);
use MIME::WordDecoder;
+#------------------------------------------------------------
+# BEGIN
+#------------------------------------------------------------
+
+# Create checker:
+my $T = typical ExtUtils::TBone;
+$T->begin(10);
+
my $mwd = (new MIME::WordDecoder::ISO_8859 1);
{
local($/) = '';
@@ -14,18 +22,24 @@
s{\A\s+|\s+\Z}{}g; # trim
my ($isgood, $expect, $enc) = split /\n/, $_, 3;
-
- # Create the expected data
+ $isgood = (uc($isgood) eq 'GOOD');
$expect = eval $expect;
my $dec = $mwd->decode($enc);
- if( $isgood eq 'GOOD' ) {
- ok( ! $@, 'No exceptions');
- is( $dec, $expect, "$enc produced correct output");
- } else {
- ok( $@, 'Got an exception as expected');
- }
-
+ $T->ok( ((($isgood && !$@) or (!$isgood && $@)) and
+ ($isgood ? ($dec eq $expect) : 1)),
+ 'Is it good?',
+ IsGood => $isgood,
+ Error => $@,
+ Encoded => $enc,
+ Decoded => $dec,
+ Expectd => $expect);
}
close WORDS;
}
+
+# Done!
+$T->end;
+exit(0);
+1;
+
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/t/Words.t
^
|
@@ -1,10 +1,18 @@
-#!/usr/bin/perl -w
+use lib "./t";
+
use strict;
-use warnings;
-use Test::More tests => 19;
+use ExtUtils::TBone;
use MIME::QuotedPrint qw(decode_qp);
-use MIME::Words qw( :all );
+use MIME::Words qw(decode_mimewords);
+
+#------------------------------------------------------------
+# BEGIN
+#------------------------------------------------------------
+
+# Create checker:
+my $T = typical ExtUtils::TBone;
+$T->begin(10);
{
local($/) = '';
@@ -13,25 +21,24 @@
s{\A\s+|\s+\Z}{}g; # trim
my ($isgood, $expect, $enc) = split /\n/, $_, 3;
-
- # Create the expected data
+ $isgood = (uc($isgood) eq 'GOOD');
$expect = eval $expect;
my $dec = decode_mimewords($enc);
- if( $isgood eq 'GOOD' ) {
- ok( ! $@, 'No exceptions');
- is( $dec, $expect, "$enc produced correct output");
- } else {
- ok( $@, 'Got an exception as expected');
- }
+ $T->ok( ((($isgood && !$@) or (!$isgood && $@)) and
+ ($isgood ? ($dec eq $expect) : 1)),
+ 'Is it good?',
+ IsGood => $isgood,
+ Error => $@,
+ Encoded => $enc,
+ Decoded => $dec,
+ Expectd => $expect);
}
close WORDS;
-}
+}
+
+# Done!
+$T->end;
+exit(0);
+1;
-# Test case for ticket 5462
-{
- my $source = 'hé hé';
- my $encoded = encode_mimewords($source, ('Encode' => 'Q', 'Charset' => 'iso-8859-1'));
- my $decoded = decode_mimewords($encoded);
- is( $decoded, $source, 'encode/decode of string with spaces matches original');
-}
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/testin/multi-igor2.msg
^
|
@@ -1,198 +1,198 @@
-Date: Thu, 6 Jun 1996 15:50:39 +0400 (MOW DST)
-From: Starovoitov Igor <igor@fripp.aic.synapse.ru>
-To: eryq@rhine.gsfc.nasa.gov
-Subject: Need help
-MIME-Version: 1.0
-Content-Type: MULTIPART/MIXED; BOUNDARY="-490585488-806670346-834061839=:2195"
-
- This message is in MIME format. The first part should be readable text,
- while the remaining parts are likely unreadable without MIME-aware tools.
- Send mail to mime@docserver.cac.washington.edu for more info.
-
----490585488-806670346-834061839=:2195
-Content-Type: TEXT/PLAIN; charset=US-ASCII
-
-Dear Sir,
-
-I have a problem with Your MIME-Parser-1.9
-and multipart-nested messages.
-Not all parts are parsed.
-
-Here my Makefile, Your own multipart-nested.msg
-and its out after "make test".
-Some my messages not completely parsed too.
-
-Is this a bug?
-
-Thank You for help.
-
-
-Igor Starovoytov.
----490585488-806670346-834061839=:2195
-Content-Type: TEXT/PLAIN; charset=US-ASCII; name=Makefile
-Content-Transfer-Encoding: BASE64
-Content-ID: <Pine.LNX.3.91.960606155039.2195B@fripp.aic.synapse.ru>
-Content-Description: Makefile
-
-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MQUdTfSBcDQoJCS0tdGl0bGU9TUlNRTo6JCogXA0KCQktLWlu
-ZmlsZT0kPCBcDQoJCS0tb3V0ZmlsZT1kb2NzLyQqLmh0bWwNCg0KIy0tLS0t
-LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
-LS0tLS0tLS0tLQ0K
----490585488-806670346-834061839=:2195
-Content-Type: TEXT/PLAIN; charset=US-ASCII; name="multi-nested.msg"
-Content-Transfer-Encoding: BASE64
-Content-ID: <Pine.LNX.3.91.960606155039.2195C@fripp.aic.synapse.ru>
-Content-Description: test message
-
-TUlNRS1WZXJzaW9uOiAxLjANCkZyb206IExvcmQgSm9obiBXaG9yZmluIDx3
-aG9yZmluQHlveW9keW5lLmNvbT4NClRvOiA8am9obi15YXlhQHlveW9keW5l
-LmNvbT4NClN1YmplY3Q6IEEgY29tcGxleCBuZXN0ZWQgbXVsdGlwYXJ0IGV4
-YW1wbGUNCkNvbnRlbnQtVHlwZTogbXVsdGlwYXJ0L21peGVkOw0KICAgICBi
-b3VuZGFyeT11bmlxdWUtYm91bmRhcnktMQ0KDQpUaGUgcHJlYW1ibGUgb2Yg
-dGhlIG91dGVyIG11bHRpcGFydCBtZXNzYWdlLg0KTWFpbCByZWFkZXJzIHRo
-YXQgdW5kZXJzdGFuZCBtdWx0aXBhcnQgZm9ybWF0DQpzaG91bGQgaWdub3Jl
-IHRoaXMgcHJlYW1ibGUuDQpJZiB5b3UgYXJlIHJlYWRpbmcgdGhpcyB0ZXh0
-LCB5b3UgbWlnaHQgd2FudCB0bw0KY29uc2lkZXIgY2hhbmdpbmcgdG8gYSBt
-YWlsIHJlYWRlciB0aGF0IHVuZGVyc3RhbmRzDQpob3cgdG8gcHJvcGVybHkg
-ZGlzcGxheSBtdWx0aXBhcnQgbWVzc2FnZXMuDQotLXVuaXF1ZS1ib3VuZGFy
-eS0xDQoNClBhcnQgMSBvZiB0aGUgb3V0ZXIgbWVzc2FnZS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tYWxsZXI+PG5sPg0KPG5sPg0KSXNuJ3Qg
-aXQgPGJpZ2dlcj48YmlnZ2VyPmNvb2w/PC9iaWdnZXI+PC9iaWdnZXI+DQoN
-Ci0tdW5pcXVlLWJvdW5kYXJ5LTENCkNvbnRlbnQtVHlwZTogbWVzc2FnZS9y
-ZmM4MjINCg0KRnJvbTogKG1haWxib3ggaW4gVVMtQVNDSUkpDQpUbzogKGFk
-ZHJlc3MgaW4gVVMtQVNDSUkpDQpTdWJqZWN0OiBQYXJ0IDUgb2YgdGhlIG91
-dGVyIG1lc3NhZ2UgaXMgaXRzZWxmIGFuIFJGQzgyMiBtZXNzYWdlIQ0KQ29u
-dGVudC1UeXBlOiBUZXh0L3BsYWluOyBjaGFyc2V0PUlTTy04ODU5LTENCkNv
-bnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IFF1b3RlZC1wcmludGFibGUNCg0K
-UGFydCA1IG9mIHRoZSBvdXRlciBtZXNzYWdlIGlzIGl0c2VsZiBhbiBSRkM4
-MjIgbWVzc2FnZSENCg0KLS11bmlxdWUtYm91bmRhcnktMS0tDQoNClRoZSBl
-cGlsb2d1ZSBmb3IgdGhlIG91dGVyIG1lc3NhZ2UuDQo=
----490585488-806670346-834061839=:2195
-Content-Type: TEXT/PLAIN; charset=US-ASCII; name="Parser.n.out"
-Content-Transfer-Encoding: BASE64
-Content-ID: <Pine.LNX.3.91.960606155039.2195D@fripp.aic.synapse.ru>
-Content-Description: out from parser
-
-KiBXYWl0aW5nIGZvciBhIE1JTUUgbWVzc2FnZSBmcm9tIFNURElOLi4uDQo9
-PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
-PT09PT09PT09PT09PT0NCkNvbnRlbnQtdHlwZTogbXVsdGlwYXJ0L21peGVk
-DQpCb2R5LWZpbGU6IE5PTkUNClN1YmplY3Q6IEEgY29tcGxleCBuZXN0ZWQg
-bXVsdGlwYXJ0IGV4YW1wbGUNCk51bS1wYXJ0czogMw0KLS0NCiAgICBDb250
-ZW50LXR5cGU6IHRleHQvcGxhaW4NCiAgICBCb2R5LWZpbGU6IC4vdGVzdG91
-dC9tc2ctMzUzOC0xLmRvYw0KICAgIC0tDQogICAgQ29udGVudC10eXBlOiB0
-ZXh0L3BsYWluDQogICAgQm9keS1maWxlOiAuL3Rlc3RvdXQvbXNnLTM1Mzgt
-Mi5kb2MNCiAgICAtLQ0KICAgIENvbnRlbnQtdHlwZTogbXVsdGlwYXJ0L3Bh
-cmFsbGVsDQogICAgQm9keS1maWxlOiBOT05FDQogICAgU3ViamVjdDogUGFy
-dCAzIG9mIHRoZSBvdXRlciBtZXNzYWdlIGlzIG11bHRpcGFydCENCiAgICBO
-dW0tcGFydHM6IDINCiAgICAtLQ0KICAgICAgICBDb250ZW50LXR5cGU6IGlt
-YWdlL2dpZg0KICAgICAgICBCb2R5LWZpbGU6IC4vdGVzdG91dC8zZC1jb21w
-cmVzcy5naWYNCiAgICAgICAgU3ViamVjdDogUGFydCAxIG9mIHRoZSBpbm5l
-ciBtZXNzYWdlIGlzIGEgR0lGLCAiM2QtY29tcHJlc3MuZ2lmIg0KICAgICAg
-ICAtLQ0KICAgICAgICBDb250ZW50LXR5cGU6IGltYWdlL2dpZg0KICAgICAg
-ICBCb2R5LWZpbGU6IC4vdGVzdG91dC8zZC1leWUuZ2lmDQogICAgICAgIFN1
-YmplY3Q6IFBhcnQgMiBvZiB0aGUgaW5uZXIgbWVzc2FnZSBpcyBhbm90aGVy
-IEdJRiwgIjNkLWV5ZS5naWYiDQogICAgICAgIC0tDQo9PT09PT09PT09PT09
-PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
-PT0NCg0K
----490585488-806670346-834061839=:2195--
+Date: Thu, 6 Jun 1996 15:50:39 +0400 (MOW DST)
+From: Starovoitov Igor <igor@fripp.aic.synapse.ru>
+To: eryq@rhine.gsfc.nasa.gov
+Subject: Need help
+MIME-Version: 1.0
+Content-Type: MULTIPART/MIXED; BOUNDARY="-490585488-806670346-834061839=:2195"
+
+ This message is in MIME format. The first part should be readable text,
+ while the remaining parts are likely unreadable without MIME-aware tools.
+ Send mail to mime@docserver.cac.washington.edu for more info.
+
+---490585488-806670346-834061839=:2195
+Content-Type: TEXT/PLAIN; charset=US-ASCII
+
+Dear Sir,
+
+I have a problem with Your MIME-Parser-1.9
+and multipart-nested messages.
+Not all parts are parsed.
+
+Here my Makefile, Your own multipart-nested.msg
+and its out after "make test".
+Some my messages not completely parsed too.
+
+Is this a bug?
+
+Thank You for help.
+
+
+Igor Starovoytov.
+---490585488-806670346-834061839=:2195
+Content-Type: TEXT/PLAIN; charset=US-ASCII; name=Makefile
+Content-Transfer-Encoding: BASE64
+Content-ID: <Pine.LNX.3.91.960606155039.2195B@fripp.aic.synapse.ru>
+Content-Description: Makefile
+
+Iy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
+LS0tLS0tLS0tLS0tLS0tLQ0KIyBNYWtlZmlsZSBmb3IgTUlNRTo6DQojLS0t
+LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
+LS0tLS0tLS0tLS0tDQoNCiMgV2hlcmUgdG8gaW5zdGFsbCB0aGUgbGlicmFy
+aWVzOg0KU0lURV9QRVJMID0gL3Vzci9saWIvcGVybDUNCg0KIyBXaGF0IFBl
+cmw1IGlzIGNhbGxlZCBvbiB5b3VyIHN5c3RlbSAobm8gbmVlZCB0byBnaXZl
+IGVudGlyZSBwYXRoKToNClBFUkw1ICAgICA9IHBlcmwNCg0KIyBZb3UgcHJv
+YmFibHkgd29uJ3QgbmVlZCB0byBjaGFuZ2UgdGhlc2UuLi4NCk1PRFMgICAg
+ICA9IERlY29kZXIucG0gRW50aXR5LnBtIEhlYWQucG0gUGFyc2VyLnBtIEJh
+c2U2NC5wbSBRdW90ZWRQcmludC5wbQ0KU0hFTEwgICAgID0gL2Jpbi9z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0KLlNVRkZJWEVTOiAucG0gLnBvZCAuaHRtbA0KDQojIHYuMS44IGdl
+bmVyYXRlZCAzMCBBcHIgOTYNCiMgdi4xLjkgaXMgb25seSBiZWNhdXNlIDEu
+OCBmYWlsZWQgQ1BBTiBpbmdlc3Rpb24NCmRpc3Q6IGRvY3VtZW50ZWQJDQoJ
+VkVSU0lPTj0xLjkgOyBcDQoJbWtkaXN0IC10Z3ogTUlNRS1wYXJzZXItJCRW
+RVJTSU9OIDsgXA0KCWNwIE1LRElTVC9NSU1FLXBhcnNlci0kJFZFUlNJT04u
+dGd6ICR7SE9NRX0vcHVibGljX2h0bWwvY3Bhbg0KCQ0KZG9jdW1lbnRlZDog
+JHtIVE1MU30gJHtNT0RTfQ0KDQoucG0uaHRtbDoNCglwb2QyaHRtbCAke1BP
+RDJIVE1MX0ZMQUdTfSBcDQoJCS0tdGl0bGU9TUlNRTo6JCogXA0KCQktLWlu
+ZmlsZT0kPCBcDQoJCS0tb3V0ZmlsZT1kb2NzLyQqLmh0bWwNCg0KIy0tLS0t
+LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
+LS0tLS0tLS0tLQ0K
+---490585488-806670346-834061839=:2195
+Content-Type: TEXT/PLAIN; charset=US-ASCII; name="multi-nested.msg"
+Content-Transfer-Encoding: BASE64
+Content-ID: <Pine.LNX.3.91.960606155039.2195C@fripp.aic.synapse.ru>
+Content-Description: test message
+
+TUlNRS1WZXJzaW9uOiAxLjANCkZyb206IExvcmQgSm9obiBXaG9yZmluIDx3
+aG9yZmluQHlveW9keW5lLmNvbT4NClRvOiA8am9obi15YXlhQHlveW9keW5l
+LmNvbT4NClN1YmplY3Q6IEEgY29tcGxleCBuZXN0ZWQgbXVsdGlwYXJ0IGV4
+YW1wbGUNCkNvbnRlbnQtVHlwZTogbXVsdGlwYXJ0L21peGVkOw0KICAgICBi
+b3VuZGFyeT11bmlxdWUtYm91bmRhcnktMQ0KDQpUa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mb3IgdGhlIG91dGVyIG1lc3NhZ2UuDQo=
+---490585488-806670346-834061839=:2195
+Content-Type: TEXT/PLAIN; charset=US-ASCII; name="Parser.n.out"
+Content-Transfer-Encoding: BASE64
+Content-ID: <Pine.LNX.3.91.960606155039.2195D@fripp.aic.synapse.ru>
+Content-Description: out from parser
+
+KiBXYWl0aW5nIGZvciBhIE1JTUUgbWVzc2FnZSBmcm9tIFNURElOLi4uDQo9
+PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
+PT09PT09PT09PT09PT0NCkNvbnRlbnQtdHlwZTogbXVsdGlwYXJ0L21peGVk
+DQpCb2R5LWZpbGU6IE5PTkUNClN1YmplY3Q6IEEgY29tcGxleCBuZXN0ZWQg
+bXVsdGlwYXJ0IGV4YW1wbGUNCk51bS1wYXJ0czogMw0KLS0NCiAgICBDb250
+ZW50LXR5cGU6IHRleHQvcGxhaW4NCiAgICBCb2R5LWZpbGU6IC4vdGVzdG91
+dC9tc2ctMzUzOC0xLmRvYw0KICAgIC0tDQogICAgQ29udGVudC10eXBlOiB0
+ZXh0L3BsYWluDQogICAgQm9keS1maWxlOiAuL3Rlc3RvdXQvbXNnLTM1Mzgt
+Mi5kb2MNCiAgICAtLQ0KICAgIENvbnRlbnQtdHlwZTogbXVsdGlwYXJ0L3Bh
+cmFsbGVsDQogICAgQm9keS1maWxlOiBOT05FDQogICAgU3ViamVjdDogUGFy
+dCAzIG9mIHRoZSBvdXRlciBtZXNzYWdlIGlzIG11bHRpcGFydCENCiAgICBO
+dW0tcGFydHM6IDINCiAgICAtLQ0KICAgICAgICBDb250ZW50LXR5cGU6IGlt
+YWdlL2dpZg0KICAgICAgICBCb2R5LWZpbGU6IC4vdGVzdG91dC8zZC1jb21w
+cmVzcy5naWYNCiAgICAgICAgU3ViamVjdDogUGFydCAxIG9mIHRoZSBpbm5l
+ciBtZXNzYWdlIGlzIGEgR0lGLCAiM2QtY29tcHJlc3MuZ2lmIg0KICAgICAg
+ICAtLQ0KICAgICAgICBDb250ZW50LXR5cGU6IGltYWdlL2dpZg0KICAgICAg
+ICBCb2R5LWZpbGU6IC4vdGVzdG91dC8zZC1leWUuZ2lmDQogICAgICAgIFN1
+YmplY3Q6IFBhcnQgMiBvZiB0aGUgaW5uZXIgbWVzc2FnZSBpcyBhbm90aGVy
+IEdJRiwgIjNkLWV5ZS5naWYiDQogICAgICAgIC0tDQo9PT09PT09PT09PT09
+PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
+PT0NCg0K
+---490585488-806670346-834061839=:2195--
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/testin/multi-nested2.msg
^
|
@@ -1,89 +1,89 @@
-MIME-Version: 1.0
-From: Lord John Whorfin <whorfin@yoyodyne.com>
-To: <john-yaya@yoyodyne.com>
-Subject: A complex nested multipart example
-Content-Type: multipart/mixed;
- boundary=unique-boundary-1
-
-The preamble of the outer multipart message.
-Mail readers that understand multipart format
-should ignore this preamble.
-If you are reading this text, you might want to
-consider changing to a mail reader that understands
-how to properly display multipart messages.
---unique-boundary-1
-
-Part 1 of the outer message.
-[Note that the preceding blank line means
-no header fields were given and this is text,
-with charset US ASCII. It could have been
-done with explicit typing as in the next part.]
-
---unique-boundary-1
-Content-type: text/plain; charset=US-ASCII
-
-Part 2 of the outer message.
-This could have been part of the previous part,
-but illustrates explicit versus implicit
-typing of body parts.
-
---unique-boundary-1
-Subject: Part 3 of the outer message is multipart!
-Content-Type: multipart/parallel;
- boundary=unique-boundary-2
-
-A one-line preamble for the inner multipart message.
---unique-boundary-2
-Content-Type: image/gif
-Content-Transfer-Encoding: base64
-Content-Disposition: inline; filename="3d-vise.gif"
-Subject: Part 1 of the inner message is a GIF, "3d-vise.gif"
-
-R0lGODdhKAAoAOMAAAAAAAAAgB6Q/y9PT25ubnCAkKBSLb6+vufn5/Xes/+lAP/6zQAAAAAA
-AAAAAAAAACwAAAAAKAAoAAAE/hDJSau9eJLMOyYbcoxkaZ5oCkoH6L5wLMfiWqd4btZhmxbA
-oFCY47EIqMJgyWw2ATjj7aRkAq5YwDMl9VGtKO0SiuoiTVlscsxt9c4HgXxUIA0EAVOVfDKT
-8Hl1B3kDAYYle202XnGGgoMHhYckiWVuR3+OTgCGeZRslotwgJ2lnYigfZdTjQULr7ALBZN0
-qTurjHgLKAu0B5Wqopm7J72etQN8t8Ijury+wMtvw8/Hv7Ylfs0BxCbGqMmK0yOOQ0GTCgrR
-2bhwJGlXJQYG6mMKoeNoWSbzCWIACe5JwxQm3AkDAbUAQCiQhDZEBeBl6afgCsOBrD45edIv
-QceGWSMevpOYhl6CkydBHhBZQmGKjihVshypjB9ClAHZMTugzOU7mzhBPiSZ5uDNnA7b/aTZ
-0mhMnfl0pDBFa6bUElSPWb0qtYuHrxlwcR17YsWMs2jTql3LFkQEADs=
---unique-boundary-2
-Content-Type: image/gif
-Content-Transfer-Encoding: base64
-Content-Disposition: inline; filename="3d-eye.gif"
-Subject: Part 2 of the inner message is another GIF, "3d-eye.gif"
-
-R0lGODdhKAAoAPMAAAAAAAAAzN3u/76+voiIiG5ubszd7v///+fn5wAAAAAAAAAAAAAAAAAA
-AAAAAAAAACwAAAAAKAAoAAAE/hDJSau9eJbMOy4bMoxkaZ5oCkoD6L5wLMfiWns41oZt7lM7
-VujnC96IRVsPWQE4nxPjkvmsQmu8oc/KBUSVWk7XepGGLeNrxoxJO1MjILjthg/kWXQ6wO/7
-+3dCeRRjfAKHiImJAV+DCF0BiW5VAo1CElaRh5NjlkeYmpyTgpcTAKGiaaSfpwKpVQaxVatL
-rU8GaQdOBAQAB7+yXliXTrgAxsW4vFabv8BOtBsBt7cGvwCIT9nOyNEIxuC4zrqKzc9XbODJ
-vs7Y5ewH3d7Fxe3jB4rj8t6PuNa6r2bhKQXN17FYCBMqTGiBzSNhx5g0nEMhlsSJjiRYvDjw
-E0cdGxQ/gswosoKUkmuU2FnJcsSKGTBjypxJsyaICAA7
---unique-boundary-2--
-
-The epilogue for the inner multipart message.
-
---unique-boundary-1
-Content-type: text/richtext
-
-This is <bold>part 4 of the outer message</bold>
-<smaller>as defined in RFC1341</smaller><nl>
-<nl>
-Isn't it <bigger><bigger>cool?</bigger></bigger>
-
---unique-boundary-1
-Content-Type: message/rfc822; name="/evil/filename";
-
-From: (mailbox in US-ASCII)
-To: (address in US-ASCII)
-Subject: Part 5 of the outer message is itself an RFC822 message!
-Content-Type: Text/plain; charset=ISO-8859-1
-Content-Transfer-Encoding: Quoted-printable
-
-Part 5 of the outer message is itself an RFC822 message!
-
---unique-boundary-1--
-
-The epilogue for the outer message.
-
+MIME-Version: 1.0
+From: Lord John Whorfin <whorfin@yoyodyne.com>
+To: <john-yaya@yoyodyne.com>
+Subject: A complex nested multipart example
+Content-Type: multipart/mixed;
+ boundary=unique-boundary-1
+
+The preamble of the outer multipart message.
+Mail readers that understand multipart format
+should ignore this preamble.
+If you are reading this text, you might want to
+consider changing to a mail reader that understands
+how to properly display multipart messages.
+--unique-boundary-1
+
+Part 1 of the outer message.
+[Note that the preceding blank line means
+no header fields were given and this is text,
+with charset US ASCII. It could have been
+done with explicit typing as in the next part.]
+
+--unique-boundary-1
+Content-type: text/plain; charset=US-ASCII
+
+Part 2 of the outer message.
+This could have been part of the previous part,
+but illustrates explicit versus implicit
+typing of body parts.
+
+--unique-boundary-1
+Subject: Part 3 of the outer message is multipart!
+Content-Type: multipart/parallel;
+ boundary=unique-boundary-2
+
+A one-line preamble for the inner multipart message.
+--unique-boundary-2
+Content-Type: image/gif
+Content-Transfer-Encoding: base64
+Content-Disposition: inline; filename="3d-vise.gif"
+Subject: Part 1 of the inner message is a GIF, "3d-vise.gif"
+
+R0lGODdhKAAoAOMAAAAAAAAAgB6Q/y9PT25ubnCAkKBSLb6+vufn5/Xes/+lAP/6zQAAAAAA
+AAAAAAAAACwAAAAAKAAoAAAE/hDJSau9eJLMOyYbcoxkaZ5oCkoH6L5wLMfiWqd4btZhmxbA
+oFCY47EIqMJgyWw2ATjj7aRkAq5YwDMl9VGtKO0SiuoiTVlscsxt9c4HgXxUIA0EAVOVfDKT
+8Hl1B3kDAYYle202XnGGgoMHhYckiWVuR3+OTgCGeZRslotwgJ2lnYigfZdTjQULr7ALBZN0
+qTurjHgLKAu0B5Wqopm7J72etQN8t8Ijury+wMtvw8/Hv7Ylfs0BxCbGqMmK0yOOQ0GTCgrR
+2bhwJGlXJQYG6mMKoeNoWSbzCWIACe5JwxQm3AkDAbUAQCiQhDZEBeBl6afgCsOBrD45edIv
+QceGWSMevpOYhl6CkydBHhBZQmGKjihVshypjB9ClAHZMTugzOU7mzhBPiSZ5uDNnA7b/aTZ
+0mhMnfl0pDBFa6bUElSPWb0qtYuHrxlwcR17YsWMs2jTql3LFkQEADs=
+--unique-boundary-2
+Content-Type: image/gif
+Content-Transfer-Encoding: base64
+Content-Disposition: inline; filename="3d-eye.gif"
+Subject: Part 2 of the inner message is another GIF, "3d-eye.gif"
+
+R0lGODdhKAAoAPMAAAAAAAAAzN3u/76+voiIiG5ubszd7v///+fn5wAAAAAAAAAAAAAAAAAA
+AAAAAAAAACwAAAAAKAAoAAAE/hDJSau9eJbMOy4bMoxkaZ5oCkoD6L5wLMfiWns41oZt7lM7
+VujnC96IRVsPWQE4nxPjkvmsQmu8oc/KBUSVWk7XepGGLeNrxoxJO1MjILjthg/kWXQ6wO/7
++3dCeRRjfAKHiImJAV+DCF0BiW5VAo1CElaRh5NjlkeYmpyTgpcTAKGiaaSfpwKpVQaxVatL
+rU8GaQdOBAQAB7+yXliXTrgAxsW4vFabv8BOtBsBt7cGvwCIT9nOyNEIxuC4zrqKzc9XbODJ
+vs7Y5ewH3d7Fxe3jB4rj8t6PuNa6r2bhKQXN17FYCBMqTGiBzSNhx5g0nEMhlsSJjiRYvDjw
+E0cdGxQ/gswosoKUkmuU2FnJcsSKGTBjypxJsyaICAA7
+--unique-boundary-2--
+
+The epilogue for the inner multipart message.
+
+--unique-boundary-1
+Content-type: text/richtext
+
+This is <bold>part 4 of the outer message</bold>
+<smaller>as defined in RFC1341</smaller><nl>
+<nl>
+Isn't it <bigger><bigger>cool?</bigger></bigger>
+
+--unique-boundary-1
+Content-Type: message/rfc822; name="/evil/filename";
+
+From: (mailbox in US-ASCII)
+To: (address in US-ASCII)
+Subject: Part 5 of the outer message is itself an RFC822 message!
+Content-Type: Text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: Quoted-printable
+
+Part 5 of the outer message is itself an RFC822 message!
+
+--unique-boundary-1--
+
+The epilogue for the outer message.
+
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/testin/words.txt
^
|
@@ -39,3 +39,6 @@
GOOD
"_-_"
=?ISO-8859-1?Q?=5F-=5F?=
+
+
+
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/testmsgs/multi-igor2.msg
^
|
@@ -1,198 +1,198 @@
-Date: Thu, 6 Jun 1996 15:50:39 +0400 (MOW DST)
-From: Starovoitov Igor <igor@fripp.aic.synapse.ru>
-To: eryq@rhine.gsfc.nasa.gov
-Subject: Need help
-MIME-Version: 1.0
-Content-Type: MULTIPART/MIXED; BOUNDARY="-490585488-806670346-834061839=:2195"
-
- This message is in MIME format. The first part should be readable text,
- while the remaining parts are likely unreadable without MIME-aware tools.
- Send mail to mime@docserver.cac.washington.edu for more info.
-
----490585488-806670346-834061839=:2195
-Content-Type: TEXT/PLAIN; charset=US-ASCII
-
-Dear Sir,
-
-I have a problem with Your MIME-Parser-1.9
-and multipart-nested messages.
-Not all parts are parsed.
-
-Here my Makefile, Your own multipart-nested.msg
-and its out after "make test".
-Some my messages not completely parsed too.
-
-Is this a bug?
-
-Thank You for help.
-
-
-Igor Starovoytov.
----490585488-806670346-834061839=:2195
-Content-Type: TEXT/PLAIN; charset=US-ASCII; name=Makefile
-Content-Transfer-Encoding: BASE64
-Content-ID: <Pine.LNX.3.91.960606155039.2195B@fripp.aic.synapse.ru>
-Content-Description: Makefile
-
-Iy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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o6JCogXA0KCQktLWlu
-ZmlsZT0kPCBcDQoJCS0tb3V0ZmlsZT1kb2NzLyQqLmh0bWwNCg0KIy0tLS0t
-LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
-LS0tLS0tLS0tLQ0K
----490585488-806670346-834061839=:2195
-Content-Type: TEXT/PLAIN; charset=US-ASCII; name="multi-nested.msg"
-Content-Transfer-Encoding: BASE64
-Content-ID: <Pine.LNX.3.91.960606155039.2195C@fripp.aic.synapse.ru>
-Content-Description: test message
-
-TUlNRS1WZXJzaW9uOiAxLjANCkZyb206IExvcmQgSm9obiBXaG9yZmluIDx3
-aG9yZmluQHlveW9keW5lLmNvbT4NClRvOiA8am9obi15YXlhQHlveW9keW5l
-LmNvbT4NClN1YmplY3Q6IEEgY29tcGxleCBuZXN0ZWQgbXVsdGlwYXJ0IGV4
-YW1wbGUNCkNvbnRlbnQtVHlwZTogbXVsdGlwYXJ0L21peGVkOw0KICAgICBi
-b3VuZGFyeT11bmlxdWUtYm91bmRhcnktMQ0KDQpUaGUgcHJlYW1ibGUgb2Yg
-dGhlIG91dGVyIG11bHRpcGFydCBtZXNzYWdlLg0KTWFpbCByZWFkZXJzIHRo
-YXQgdW5kZXJzdGFuZCBtdWx0aXBhcnQgZm9ybWF0DQpzaG91bGQgaWdub3Jl
-IHRoaXMgcHJlYW1ibGUuDQpJZiB5b3UgYXJlIHJlYWRpbmcgdGhpcyB0ZXh0
-LCB5b3UgbWlnaHQgd2FudCB0bw0KY29uc2lkZXIgY2hhbmdpbmcgdG8gYSBt
-YWlsIHJlYWRlciB0aGF0IHVuZGVyc3RhbmRzDQpob3cgdG8gcHJvcGVybHkg
-ZGlzcGxheSBtdWx0aXBhcnQgbWVzc2FnZXMuDQotLXVuaXF1ZS1ib3VuZGFy
-eS0xDQoNClBhcnQgMSBvZiB0aGUgb3V0ZXIgbWVzc2FnZS4NCltOb3RlIHRo
-YXQgdGhlIHByZWNlZ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3Qg
-aXQgPGJpZ2dlcj48YmlnZ2VyPmNvb2w/PC9iaWdnZXI+PC9iaWdnZXI+DQoN
-Ci0tdW5pcXVlLWJvdW5kYXJ5LTENCkNvbnRlbnQtVHlwZTogbWVzc2FnZS9y
-ZmM4MjINCg0KRnJvbTogKG1haWxib3ggaW4gVVMtQVNDSUkpDQpUbzogKGFk
-ZHJlc3MgaW4gVVMtQVNDSUkpDQpTdWJqZWN0OiBQYXJ0IDUgb2YgdGhlIG91
-dGVyIG1lc3NhZ2UgaXMgaXRzZWxmIGFuIFJGQzgyMiBtZXNzYWdlIQ0KQ29u
-dGVudC1UeXBlOiBUZXh0L3BsYWluOyBjaGFyc2V0PUlTTy04ODU5LTENCkNv
-bnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IFF1b3RlZC1wcmludGFibGUNCg0K
-UGFydCA1IG9mIHRoZSBvdXRlciBtZXNzYWdlIGlzIGl0c2VsZiBhbiBSRkM4
-MjIgbWVzc2FnZSENCg0KLS11bmlxdWUtYm91bmRhcnktMS0tDQoNClRoZSBl
-cGlsb2d1ZSBmb3IgdGhlIG91dGVyIG1lc3NhZ2UuDQo=
----490585488-806670346-834061839=:2195
-Content-Type: TEXT/PLAIN; charset=US-ASCII; name="Parser.n.out"
-Content-Transfer-Encoding: BASE64
-Content-ID: <Pine.LNX.3.91.960606155039.2195D@fripp.aic.synapse.ru>
-Content-Description: out from parser
-
-KiBXYWl0aW5nIGZvciBhIE1JTUUgbWVzc2FnZSBmcm9tIFNURElOLi4uDQo9
-PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
-PT09PT09PT09PT09PT0NCkNvbnRlbnQtdHlwZTogbXVsdGlwYXJ0L21peGVk
-DQpCb2R5LWZpbGU6IE5PTkUNClN1YmplY3Q6IEEgY29tcGxleCBuZXN0ZWQg
-bXVsdGlwYXJ0IGV4YW1wbGUNCk51bS1wYXJ0czogMw0KLS0NCiAgICBDb250
-ZW50LXR5cGU6IHRleHQvcGxhaW4NCiAgICBCb2R5LWZpbGU6IC4vdGVzdG91
-dC9tc2ctMzUzOC0xLmRvYw0KICAgIC0tDQogICAgQ29udGVudC10eXBlOiB0
-ZXh0L3BsYWluDQogICAgQm9keS1maWxlOiAuL3Rlc3RvdXQvbXNnLTM1Mzgt
-Mi5kb2MNCiAgICAtLQ0KICAgIENvbnRlbnQtdHlwZTogbXVsdGlwYXJ0L3Bh
-cmFsbGVsDQogICAgQm9keS1maWxlOiBOT05FDQogICAgU3ViamVjdDogUGFy
-dCAzIG9mIHRoZSBvdXRlciBtZXNzYWdlIGlzIG11bHRpcGFydCENCiAgICBO
-dW0tcGFydHM6IDINCiAgICAtLQ0KICAgICAgICBDb250ZW50LXR5cGU6IGlt
-YWdlL2dpZg0KICAgICAgICBCb2R5LWZpbGU6IC4vdGVzdG91dC8zZC1jb21w
-cmVzcy5naWYNCiAgICAgICAgU3ViamVjdDogUGFydCAxIG9mIHRoZSBpbm5l
-ciBtZXNzYWdlIGlzIGEgR0lGLCAiM2QtY29tcHJlc3MuZ2lmIg0KICAgICAg
-ICAtLQ0KICAgICAgICBDb250ZW50LXR5cGU6IGltYWdlL2dpZg0KICAgICAg
-ICBCb2R5LWZpbGU6IC4vdGVzdG91dC8zZC1leWUuZ2lmDQogICAgICAgIFN1
-YmplY3Q6IFBhcnQgMiBvZiB0aGUgaW5uZXIgbWVzc2FnZSBpcyBhbm90aGVy
-IEdJRiwgIjNkLWV5ZS5naWYiDQogICAgICAgIC0tDQo9PT09PT09PT09PT09
-PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
-PT0NCg0K
----490585488-806670346-834061839=:2195--
+Date: Thu, 6 Jun 1996 15:50:39 +0400 (MOW DST)
+From: Starovoitov Igor <igor@fripp.aic.synapse.ru>
+To: eryq@rhine.gsfc.nasa.gov
+Subject: Need help
+MIME-Version: 1.0
+Content-Type: MULTIPART/MIXED; BOUNDARY="-490585488-806670346-834061839=:2195"
+
+ This message is in MIME format. The first part should be readable text,
+ while the remaining parts are likely unreadable without MIME-aware tools.
+ Send mail to mime@docserver.cac.washington.edu for more info.
+
+---490585488-806670346-834061839=:2195
+Content-Type: TEXT/PLAIN; charset=US-ASCII
+
+Dear Sir,
+
+I have a problem with Your MIME-Parser-1.9
+and multipart-nested messages.
+Not all parts are parsed.
+
+Here my Makefile, Your own multipart-nested.msg
+and its out after "make test".
+Some my messages not completely parsed too.
+
+Is this a bug?
+
+Thank You for help.
+
+
+Igor Starovoytov.
+---490585488-806670346-834061839=:2195
+Content-Type: TEXT/PLAIN; charset=US-ASCII; name=Makefile
+Content-Transfer-Encoding: BASE64
+Content-ID: <Pine.LNX.3.91.960606155039.2195B@fripp.aic.synapse.ru>
+Content-Description: Makefile
+
+Iy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
+LS0tLS0tLS0tLS0tLS0tLQ0KIyBNYWtlZmlsZSBmb3IgTUlNRTo6DQojLS0t
+LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
+LS0tLS0tLS0tLS0tDQoNCiMgV2hlcmUgdG8gaW5zdGFsbCB0aGUgbGlicmFy
+aWVzOg0KU0lURV9QRVJMID0gL3Vzci9saWIvcGVybDUNCg0KIyBXaGF0IFBl
+cmw1IGlzIGNhbGxlZCBvbiB5b3VyIHN5c3RlbSAobm8gbmVlZCB0byBnaXZl
+IGVudGlyZSBwYXRoKToNClBFUkw1ICAgICA9IHBlcmwNCg0KIyBZb3UgcHJv
+YmFibHkgd29uJ3QgbmVlZCB0byBjaGFuZ2UgdGhlc2UuLi4NCk1PRFMgICAg
+ICA9IERlY29kZXIucG0gRW50aXR5LnBtIEhlYWQucG0gUGFyc2VyLnBtIEJh
+c2U2NC5wbSBRdW90ZWRQcmludC5wbQ0KU0hFTEwgICAgID0gL2Jpbi9zaA0K
+DQojLS0tLS0tLS0tLS0tLS0tLS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RtbA0KDQojIHYuMS44IGdl
+bmVyYXRlZCAzMCBBcHIgOTYNCiMgdi4xLjkgaXMgb25seSBiZWNhdXNlIDEu
+OCBmYWlsZWQgQ1BBTiBpbmdlc3Rpb24NCmRpc3Q6IGRvY3VtZW50ZWQJDQoJ
+VkVSU0lPTj0xLjkgOyBcDQoJbWtkaXN0IC10Z3ogTUlNRS1wYXJzZXItJCRW
+RVJTSU9OIDsgXA0KCWNwIE1LRElTVC9NSU1FLXBhcnNlci0kJFZFUlNJT04u
+dGd6ICR7SE9NRX0vcHVibGljX2h0bWwvY3Bhbg0KCQ0KZG9jdW1lbnRlZDog
+JHtIVE1MU30gJHtNT0RTfQ0KDQoucG0uaHRtbDoNCglwb2QyaHRtbCAke1BP
+RDJIVE1MX0ZMQUdTfSBcDQoJCS0tdGl0bGU9TUlNRTo6JCogXA0KCQktLWlu
+ZmlsZT0kPCBcDQoJCS0tb3V0ZmlsZT1kb2NzLyQqLmh0bWwNCg0KIy0tLS0t
+LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
+LS0tLS0tLS0tLQ0K
+---490585488-806670346-834061839=:2195
+Content-Type: TEXT/PLAIN; charset=US-ASCII; name="multi-nested.msg"
+Content-Transfer-Encoding: BASE64
+Content-ID: <Pine.LNX.3.91.960606155039.2195C@fripp.aic.synapse.ru>
+Content-Description: test message
+
+TUlNRS1WZXJzaW9uOiAxLjANCkZyb206IExvcmQgSm9obiBXaG9yZmluIDx3
+aG9yZmluQHlveW9keW5lLmNvbT4NClRvOiA8am9obi15YXlhQHlveW9keW5l
+LmNvbT4NClN1YmplY3Q6IEEgY29tcGxleCBuZXN0ZWQgbXVsdGlwYXJ0IGV4
+YW1wbGUNCkNvbnRlbnQtVHlwZTogbXVsdGlwYXJ0L21peGVkOw0KICAgICBi
+b3VuZGFyeT11bmlxdWUtYm91bmRhcnktMQ0KDQpUaGUgcHJlYW1ibGUgb2Yg
+dGhlIG91dG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o=
+---490585488-806670346-834061839=:2195
+Content-Type: TEXT/PLAIN; charset=US-ASCII; name="Parser.n.out"
+Content-Transfer-Encoding: BASE64
+Content-ID: <Pine.LNX.3.91.960606155039.2195D@fripp.aic.synapse.ru>
+Content-Description: out from parser
+
+KiBXYWl0aW5nIGZvciBhIE1JTUUgbWVzc2FnZSBmcm9tIFNURElOLi4uDQo9
+PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
+PT09PT09PT09PT09PT0NCkNvbnRlbnQtdHlwZTogbXVsdGlwYXJ0L21peGVk
+DQpCb2R5LWZpbGU6IE5PTkUNClN1YmplY3Q6IEEgY29tcGxleCBuZXN0ZWQg
+bXVsdGlwYXJ0IGV4YW1wbGUNCk51bS1wYXJ0czogMw0KLS0NCiAgICBDb250
+ZW50LXR5cGU6IHRleHQvcGxhaW4NCiAgICBCb2R5LWZpbGU6IC4vdGVzdG91
+dC9tc2ctMzUzOC0xLmRvYw0KICAgIC0tDQogICAgQ29udGVudC10eXBlOiB0
+ZXh0L3BsYWluDQogICAgQm9keS1maWxlOiAuL3Rlc3RvdXQvbXNnLTM1Mzgt
+Mi5kb2MNCiAgICAtLQ0KICAgIENvbnRlbnQtdHlwZTogbXVsdGlwYXJ0L3Bh
+cmFsbGVsDQogICAgQm9keS1maWxlOiBOT05FDQogICAgU3ViamVjdDogUGFy
+dCAzIG9mIHRoZSBvdXRlciBtZXNzYWdlIGlzIG11bHRpcGFydCENCiAgICBO
+dW0tcGFydHM6IDINCiAgICAtLQ0KICAgICAgICBDb250ZW50LXR5cGU6IGlt
+YWdlL2dpZg0KICAgICAgICBCb2R5LWZpbGU6IC4vdGVzdG91dC8zZC1jb21w
+cmVzcy5naWYNCiAgICAgICAgU3ViamVjdDogUGFydCAxIG9mIHRoZSBpbm5l
+ciBtZXNzYWdlIGlzIGEgR0lGLCAiM2QtY29tcHJlc3MuZ2lmIg0KICAgICAg
+ICAtLQ0KICAgICAgICBDb250ZW50LXR5cGU6IGltYWdlL2dpZg0KICAgICAg
+ICBCb2R5LWZpbGU6IC4vdGVzdG91dC8zZC1leWUuZ2lmDQogICAgICAgIFN1
+YmplY3Q6IFBhcnQgMiBvZiB0aGUgaW5uZXIgbWVzc2FnZSBpcyBhbm90aGVy
+IEdJRiwgIjNkLWV5ZS5naWYiDQogICAgICAgIC0tDQo9PT09PT09PT09PT09
+PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
+PT0NCg0K
+---490585488-806670346-834061839=:2195--
|
[-]
[+]
|
Changed |
MIME-tools-5.420.tar.bz2/testmsgs/multi-nested2.msg
^
|
@@ -1,89 +1,89 @@
-MIME-Version: 1.0
-From: Lord John Whorfin <whorfin@yoyodyne.com>
-To: <john-yaya@yoyodyne.com>
-Subject: A complex nested multipart example
-Content-Type: multipart/mixed;
- boundary=unique-boundary-1
-
-The preamble of the outer multipart message.
-Mail readers that understand multipart format
-should ignore this preamble.
-If you are reading this text, you might want to
-consider changing to a mail reader that understands
-how to properly display multipart messages.
---unique-boundary-1
-
-Part 1 of the outer message.
-[Note that the preceding blank line means
-no header fields were given and this is text,
-with charset US ASCII. It could have been
-done with explicit typing as in the next part.]
-
---unique-boundary-1
-Content-type: text/plain; charset=US-ASCII
-
-Part 2 of the outer message.
-This could have been part of the previous part,
-but illustrates explicit versus implicit
-typing of body parts.
-
---unique-boundary-1
-Subject: Part 3 of the outer message is multipart!
-Content-Type: multipart/parallel;
- boundary=unique-boundary-2
-
-A one-line preamble for the inner multipart message.
---unique-boundary-2
-Content-Type: image/gif
-Content-Transfer-Encoding: base64
-Content-Disposition: inline; filename="3d-vise.gif"
-Subject: Part 1 of the inner message is a GIF, "3d-vise.gif"
-
-R0lGODdhKAAoAOMAAAAAAAAAgB6Q/y9PT25ubnCAkKBSLb6+vufn5/Xes/+lAP/6zQAAAAAA
-AAAAAAAAACwAAAAAKAAoAAAE/hDJSau9eJLMOyYbcoxkaZ5oCkoH6L5wLMfiWqd4btZhmxbA
-oFCY47EIqMJgyWw2ATjj7aRkAq5YwDMl9VGtKO0SiuoiTVlscsxt9c4HgXxUIA0EAVOVfDKT
-8Hl1B3kDAYYle202XnGGgoMHhYckiWVuR3+OTgCGeZRslotwgJ2lnYigfZdTjQULr7ALBZN0
-qTurjHgLKAu0B5Wqopm7J72etQN8t8Ijury+wMtvw8/Hv7Ylfs0BxCbGqMmK0yOOQ0GTCgrR
-2bhwJGlXJQYG6mMKoeNoWSbzCWIACe5JwxQm3AkDAbUAQCiQhDZEBeBl6afgCsOBrD45edIv
-QceGWSMevpOYhl6CkydBHhBZQmGKjihVshypjB9ClAHZMTugzOU7mzhBPiSZ5uDNnA7b/aTZ
-0mhMnfl0pDBFa6bUElSPWb0qtYuHrxlwcR17YsWMs2jTql3LFkQEADs=
---unique-boundary-2
-Content-Type: image/gif
-Content-Transfer-Encoding: base64
-Content-Disposition: inline; filename="3d-eye.gif"
-Subject: Part 2 of the inner message is another GIF, "3d-eye.gif"
-
-R0lGODdhKAAoAPMAAAAAAAAAzN3u/76+voiIiG5ubszd7v///+fn5wAAAAAAAAAAAAAAAAAA
-AAAAAAAAACwAAAAAKAAoAAAE/hDJSau9eJbMOy4bMoxkaZ5oCkoD6L5wLMfiWns41oZt7lM7
-VujnC96IRVsPWQE4nxPjkvmsQmu8oc/KBUSVWk7XepGGLeNrxoxJO1MjILjthg/kWXQ6wO/7
-+3dCeRRjfAKHiImJAV+DCF0BiW5VAo1CElaRh5NjlkeYmpyTgpcTAKGiaaSfpwKpVQaxVatL
-rU8GaQdOBAQAB7+yXliXTrgAxsW4vFabv8BOtBsBt7cGvwCIT9nOyNEIxuC4zrqKzc9XbODJ
-vs7Y5ewH3d7Fxe3jB4rj8t6PuNa6r2bhKQXN17FYCBMqTGiBzSNhx5g0nEMhlsSJjiRYvDjw
-E0cdGxQ/gswosoKUkmuU2FnJcsSKGTBjypxJsyaICAA7
---unique-boundary-2--
-
-The epilogue for the inner multipart message.
-
---unique-boundary-1
-Content-type: text/richtext
-
-This is <bold>part 4 of the outer message</bold>
-<smaller>as defined in RFC1341</smaller><nl>
-<nl>
-Isn't it <bigger><bigger>cool?</bigger></bigger>
-
---unique-boundary-1
-Content-Type: message/rfc822; name="/evil/filename";
-
-From: (mailbox in US-ASCII)
-To: (address in US-ASCII)
-Subject: Part 5 of the outer message is itself an RFC822 message!
-Content-Type: Text/plain; charset=ISO-8859-1
-Content-Transfer-Encoding: Quoted-printable
-
-Part 5 of the outer message is itself an RFC822 message!
-
---unique-boundary-1--
-
-The epilogue for the outer message.
-
+MIME-Version: 1.0
+From: Lord John Whorfin <whorfin@yoyodyne.com>
+To: <john-yaya@yoyodyne.com>
+Subject: A complex nested multipart example
+Content-Type: multipart/mixed;
+ boundary=unique-boundary-1
+
+The preamble of the outer multipart message.
+Mail readers that understand multipart format
+should ignore this preamble.
+If you are reading this text, you might want to
+consider changing to a mail reader that understands
+how to properly display multipart messages.
+--unique-boundary-1
+
+Part 1 of the outer message.
+[Note that the preceding blank line means
+no header fields were given and this is text,
+with charset US ASCII. It could have been
+done with explicit typing as in the next part.]
+
+--unique-boundary-1
+Content-type: text/plain; charset=US-ASCII
+
+Part 2 of the outer message.
+This could have been part of the previous part,
+but illustrates explicit versus implicit
+typing of body parts.
+
+--unique-boundary-1
+Subject: Part 3 of the outer message is multipart!
+Content-Type: multipart/parallel;
+ boundary=unique-boundary-2
+
+A one-line preamble for the inner multipart message.
+--unique-boundary-2
+Content-Type: image/gif
+Content-Transfer-Encoding: base64
+Content-Disposition: inline; filename="3d-vise.gif"
+Subject: Part 1 of the inner message is a GIF, "3d-vise.gif"
+
+R0lGODdhKAAoAOMAAAAAAAAAgB6Q/y9PT25ubnCAkKBSLb6+vufn5/Xes/+lAP/6zQAAAAAA
+AAAAAAAAACwAAAAAKAAoAAAE/hDJSau9eJLMOyYbcoxkaZ5oCkoH6L5wLMfiWqd4btZhmxbA
+oFCY47EIqMJgyWw2ATjj7aRkAq5YwDMl9VGtKO0SiuoiTVlscsxt9c4HgXxUIA0EAVOVfDKT
+8Hl1B3kDAYYle202XnGGgoMHhYckiWVuR3+OTgCGeZRslotwgJ2lnYigfZdTjQULr7ALBZN0
+qTurjHgLKAu0B5Wqopm7J72etQN8t8Ijury+wMtvw8/Hv7Ylfs0BxCbGqMmK0yOOQ0GTCgrR
+2bhwJGlXJQYG6mMKoeNoWSbzCWIACe5JwxQm3AkDAbUAQCiQhDZEBeBl6afgCsOBrD45edIv
+QceGWSMevpOYhl6CkydBHhBZQmGKjihVshypjB9ClAHZMTugzOU7mzhBPiSZ5uDNnA7b/aTZ
+0mhMnfl0pDBFa6bUElSPWb0qtYuHrxlwcR17YsWMs2jTql3LFkQEADs=
+--unique-boundary-2
+Content-Type: image/gif
+Content-Transfer-Encoding: base64
+Content-Disposition: inline; filename="3d-eye.gif"
+Subject: Part 2 of the inner message is another GIF, "3d-eye.gif"
+
+R0lGODdhKAAoAPMAAAAAAAAAzN3u/76+voiIiG5ubszd7v///+fn5wAAAAAAAAAAAAAAAAAA
+AAAAAAAAACwAAAAAKAAoAAAE/hDJSau9eJbMOy4bMoxkaZ5oCkoD6L5wLMfiWns41oZt7lM7
+VujnC96IRVsPWQE4nxPjkvmsQmu8oc/KBUSVWk7XepGGLeNrxoxJO1MjILjthg/kWXQ6wO/7
++3dCeRRjfAKHiImJAV+DCF0BiW5VAo1CElaRh5NjlkeYmpyTgpcTAKGiaaSfpwKpVQaxVatL
+rU8GaQdOBAQAB7+yXliXTrgAxsW4vFabv8BOtBsBt7cGvwCIT9nOyNEIxuC4zrqKzc9XbODJ
+vs7Y5ewH3d7Fxe3jB4rj8t6PuNa6r2bhKQXN17FYCBMqTGiBzSNhx5g0nEMhlsSJjiRYvDjw
+E0cdGxQ/gswosoKUkmuU2FnJcsSKGTBjypxJsyaICAA7
+--unique-boundary-2--
+
+The epilogue for the inner multipart message.
+
+--unique-boundary-1
+Content-type: text/richtext
+
+This is <bold>part 4 of the outer message</bold>
+<smaller>as defined in RFC1341</smaller><nl>
+<nl>
+Isn't it <bigger><bigger>cool?</bigger></bigger>
+
+--unique-boundary-1
+Content-Type: message/rfc822; name="/evil/filename";
+
+From: (mailbox in US-ASCII)
+To: (address in US-ASCII)
+Subject: Part 5 of the outer message is itself an RFC822 message!
+Content-Type: Text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: Quoted-printable
+
+Part 5 of the outer message is itself an RFC822 message!
+
+--unique-boundary-1--
+
+The epilogue for the outer message.
+
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/inc
^
|
-(directory)
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/inc/Module
^
|
-(directory)
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/inc/Module/AutoInstall.pm
^
|
@@ -1,768 +0,0 @@
-#line 1
-package Module::AutoInstall;
-
-use strict;
-use Cwd ();
-use ExtUtils::MakeMaker ();
-
-use vars qw{$VERSION};
-BEGIN {
- $VERSION = '1.03';
-}
-
-# special map on pre-defined feature sets
-my %FeatureMap = (
- '' => 'Core Features', # XXX: deprecated
- '-core' => 'Core Features',
-);
-
-# various lexical flags
-my ( @Missing, @Existing, %DisabledTests, $UnderCPAN, $HasCPANPLUS );
-my ( $Config, $CheckOnly, $SkipInstall, $AcceptDefault, $TestOnly );
-my ( $PostambleActions, $PostambleUsed );
-
-# See if it's a testing or non-interactive session
-_accept_default( $ENV{AUTOMATED_TESTING} or ! -t STDIN );
-_init();
-
-sub _accept_default {
- $AcceptDefault = shift;
-}
-
-sub missing_modules {
- return @Missing;
-}
-
-sub do_install {
- __PACKAGE__->install(
- [
- $Config
- ? ( UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
- : ()
- ],
- @Missing,
- );
-}
-
-# initialize various flags, and/or perform install
-sub _init {
- foreach my $arg (
- @ARGV,
- split(
- /[\s\t]+/,
- $ENV{PERL_AUTOINSTALL} || $ENV{PERL_EXTUTILS_AUTOINSTALL} || ''
- )
- )
- {
- if ( $arg =~ /^--config=(.*)$/ ) {
- $Config = [ split( ',', $1 ) ];
- }
- elsif ( $arg =~ /^--installdeps=(.*)$/ ) {
- __PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) );
- exit 0;
- }
- elsif ( $arg =~ /^--default(?:deps)?$/ ) {
- $AcceptDefault = 1;
- }
- elsif ( $arg =~ /^--check(?:deps)?$/ ) {
- $CheckOnly = 1;
- }
- elsif ( $arg =~ /^--skip(?:deps)?$/ ) {
- $SkipInstall = 1;
- }
- elsif ( $arg =~ /^--test(?:only)?$/ ) {
- $TestOnly = 1;
- }
- }
-}
-
-# overrides MakeMaker's prompt() to automatically accept the default choice
-sub _prompt {
- goto &ExtUtils::MakeMaker::prompt unless $AcceptDefault;
-
- my ( $prompt, $default ) = @_;
- my $y = ( $default =~ /^[Yy]/ );
-
- print $prompt, ' [', ( $y ? 'Y' : 'y' ), '/', ( $y ? 'n' : 'N' ), '] ';
- print "$default\n";
- return $default;
-}
-
-# the workhorse
-sub import {
- my $class = shift;
- my @args = @_ or return;
- my $core_all;
-
- print "*** $class version " . $class->VERSION . "\n";
- print "*** Checking for Perl dependencies...\n";
-
- my $cwd = Cwd::cwd();
-
- $Config = [];
-
- my $maxlen = length(
- (
- sort { length($b) <=> length($a) }
- grep { /^[^\-]/ }
- map {
- ref($_)
- ? ( ( ref($_) eq 'HASH' ) ? keys(%$_) : @{$_} )
- : ''
- }
- map { +{@args}->{$_} }
- grep { /^[^\-]/ or /^-core$/i } keys %{ +{@args} }
- )[0]
- );
-
- while ( my ( $feature, $modules ) = splice( @args, 0, 2 ) ) {
- my ( @required, @tests, @skiptests );
- my $default = 1;
- my $conflict = 0;
-
- if ( $feature =~ m/^-(\w+)$/ ) {
- my $option = lc($1);
-
- # check for a newer version of myself
- _update_to( $modules, @_ ) and return if $option eq 'version';
-
- # sets CPAN configuration options
- $Config = $modules if $option eq 'config';
-
- # promote every features to core status
- $core_all = ( $modules =~ /^all$/i ) and next
- if $option eq 'core';
-
- next unless $option eq 'core';
- }
-
- print "[" . ( $FeatureMap{ lc($feature) } || $feature ) . "]\n";
-
- $modules = [ %{$modules} ] if UNIVERSAL::isa( $modules, 'HASH' );
-
- unshift @$modules, -default => &{ shift(@$modules) }
- if ( ref( $modules->[0] ) eq 'CODE' ); # XXX: bugward combatability
-
- while ( my ( $mod, $arg ) = splice( @$modules, 0, 2 ) ) {
- if ( $mod =~ m/^-(\w+)$/ ) {
- my $option = lc($1);
-
- $default = $arg if ( $option eq 'default' );
- $conflict = $arg if ( $option eq 'conflict' );
- @tests = @{$arg} if ( $option eq 'tests' );
- @skiptests = @{$arg} if ( $option eq 'skiptests' );
-
- next;
- }
-
- printf( "- %-${maxlen}s ...", $mod );
-
- if ( $arg and $arg =~ /^\D/ ) {
- unshift @$modules, $arg;
- $arg = 0;
- }
-
- # XXX: check for conflicts and uninstalls(!) them.
- if (
- defined( my $cur = _version_check( _load($mod), $arg ||= 0 ) ) )
- {
- print "loaded. ($cur" . ( $arg ? " >= $arg" : '' ) . ")\n";
- push @Existing, $mod => $arg;
- $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
- }
- else {
- print "missing." . ( $arg ? " (would need $arg)" : '' ) . "\n";
- push @required, $mod => $arg;
- }
- }
-
- next unless @required;
-
- my $mandatory = ( $feature eq '-core' or $core_all );
-
- if (
- !$SkipInstall
- and (
- $CheckOnly
- or _prompt(
- qq{==> Auto-install the }
- . ( @required / 2 )
- . ( $mandatory ? ' mandatory' : ' optional' )
- . qq{ module(s) from CPAN?},
- $default ? 'y' : 'n',
- ) =~ /^[Yy]/
- )
- )
- {
- push( @Missing, @required );
- $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
- }
-
- elsif ( !$SkipInstall
- and $default
- and $mandatory
- and
- _prompt( qq{==> The module(s) are mandatory! Really skip?}, 'n', )
- =~ /^[Nn]/ )
- {
- push( @Missing, @required );
- $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
- }
-
- else {
- $DisabledTests{$_} = 1 for map { glob($_) } @tests;
- }
- }
-
- $UnderCPAN = _check_lock(); # check for $UnderCPAN
-
- if ( @Missing and not( $CheckOnly or $UnderCPAN ) ) {
- require Config;
- print
-"*** Dependencies will be installed the next time you type '$Config::Config{make}'.\n";
-
- # make an educated guess of whether we'll need root permission.
- print " (You may need to do that as the 'root' user.)\n"
- if eval '$>';
- }
- print "*** $class configuration finished.\n";
-
- chdir $cwd;
-
- # import to main::
- no strict 'refs';
- *{'main::WriteMakefile'} = \&Write if caller(0) eq 'main';
-}
-
-# Check to see if we are currently running under CPAN.pm and/or CPANPLUS;
-# if we are, then we simply let it taking care of our dependencies
-sub _check_lock {
- return unless @Missing;
-
- if ($ENV{PERL5_CPANPLUS_IS_RUNNING}) {
- print <<'END_MESSAGE';
-
-*** Since we're running under CPANPLUS, I'll just let it take care
- of the dependency's installation later.
-END_MESSAGE
- return 1;
- }
-
- _load_cpan();
-
- # Find the CPAN lock-file
- my $lock = MM->catfile( $CPAN::Config->{cpan_home}, ".lock" );
- return unless -f $lock;
-
- # Check the lock
- local *LOCK;
- return unless open(LOCK, $lock);
-
- if (
- ( $^O eq 'MSWin32' ? _under_cpan() : <LOCK> == getppid() )
- and ( $CPAN::Config->{prerequisites_policy} || '' ) ne 'ignore'
- ) {
- print <<'END_MESSAGE';
-
-*** Since we're running under CPAN, I'll just let it take care
- of the dependency's installation later.
-END_MESSAGE
- return 1;
- }
-
- close LOCK;
- return;
-}
-
-sub install {
- my $class = shift;
-
- my $i; # used below to strip leading '-' from config keys
- my @config = ( map { s/^-// if ++$i; $_ } @{ +shift } );
-
- my ( @modules, @installed );
- while ( my ( $pkg, $ver ) = splice( @_, 0, 2 ) ) {
-
- # grep out those already installed
- if ( defined( _version_check( _load($pkg), $ver ) ) ) {
- push @installed, $pkg;
- }
- else {
- push @modules, $pkg, $ver;
- }
- }
-
- return @installed unless @modules; # nothing to do
- return @installed if _check_lock(); # defer to the CPAN shell
-
- print "*** Installing dependencies...\n";
-
- return unless _connected_to('cpan.org');
-
- my %args = @config;
- my %failed;
- local *FAILED;
- if ( $args{do_once} and open( FAILED, '.#autoinstall.failed' ) ) {
- while (<FAILED>) { chomp; $failed{$_}++ }
- close FAILED;
-
- my @newmod;
- while ( my ( $k, $v ) = splice( @modules, 0, 2 ) ) {
- push @newmod, ( $k => $v ) unless $failed{$k};
- }
- @modules = @newmod;
- }
-
- if ( _has_cpanplus() ) {
- _install_cpanplus( \@modules, \@config );
- } else {
- _install_cpan( \@modules, \@config );
- }
-
- print "*** $class installation finished.\n";
-
- # see if we have successfully installed them
- while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
- if ( defined( _version_check( _load($pkg), $ver ) ) ) {
- push @installed, $pkg;
- }
- elsif ( $args{do_once} and open( FAILED, '>> .#autoinstall.failed' ) ) {
- print FAILED "$pkg\n";
- }
- }
-
- close FAILED if $args{do_once};
-
- return @installed;
-}
-
-sub _install_cpanplus {
- my @modules = @{ +shift };
- my @config = _cpanplus_config( @{ +shift } );
- my $installed = 0;
-
- require CPANPLUS::Backend;
- my $cp = CPANPLUS::Backend->new;
- my $conf = $cp->configure_object;
-
- return unless $conf->can('conf') # 0.05x+ with "sudo" support
- or _can_write($conf->_get_build('base')); # 0.04x
-
- # if we're root, set UNINST=1 to avoid trouble unless user asked for it.
- my $makeflags = $conf->get_conf('makeflags') || '';
- if ( UNIVERSAL::isa( $makeflags, 'HASH' ) ) {
- # 0.03+ uses a hashref here
- $makeflags->{UNINST} = 1 unless exists $makeflags->{UNINST};
-
- } else {
- # 0.02 and below uses a scalar
- $makeflags = join( ' ', split( ' ', $makeflags ), 'UNINST=1' )
- if ( $makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' } );
-
- }
- $conf->set_conf( makeflags => $makeflags );
- $conf->set_conf( prereqs => 1 );
-
-
-
- while ( my ( $key, $val ) = splice( @config, 0, 2 ) ) {
- $conf->set_conf( $key, $val );
- }
-
- my $modtree = $cp->module_tree;
- while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
- print "*** Installing $pkg...\n";
-
- MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall;
-
- my $success;
- my $obj = $modtree->{$pkg};
-
- if ( $obj and defined( _version_check( $obj->{version}, $ver ) ) ) {
- my $pathname = $pkg;
- $pathname =~ s/::/\\W/;
-
- foreach my $inc ( grep { m/$pathname.pm/i } keys(%INC) ) {
- delete $INC{$inc};
- }
-
- my $rv = $cp->install( modules => [ $obj->{module} ] );
-
- if ( $rv and ( $rv->{ $obj->{module} } or $rv->{ok} ) ) {
- print "*** $pkg successfully installed.\n";
- $success = 1;
- } else {
- print "*** $pkg installation cancelled.\n";
- $success = 0;
- }
-
- $installed += $success;
- } else {
- print << ".";
-*** Could not find a version $ver or above for $pkg; skipping.
-.
- }
-
- MY::postinstall( $pkg, $ver, $success ) if defined &MY::postinstall;
- }
-
- return $installed;
-}
-
-sub _cpanplus_config {
- my @config = ();
- while ( @_ ) {
- my ($key, $value) = (shift(), shift());
- if ( $key eq 'prerequisites_policy' ) {
- if ( $value eq 'follow' ) {
- $value = CPANPLUS::Internals::Constants::PREREQ_INSTALL();
- } elsif ( $value eq 'ask' ) {
- $value = CPANPLUS::Internals::Constants::PREREQ_ASK();
- } elsif ( $value eq 'ignore' ) {
- $value = CPANPLUS::Internals::Constants::PREREQ_IGNORE();
- } else {
- die "*** Cannot convert option $key = '$value' to CPANPLUS version.\n";
- }
- } else {
- die "*** Cannot convert option $key to CPANPLUS version.\n";
- }
- }
- return @config;
-}
-
-sub _install_cpan {
- my @modules = @{ +shift };
- my @config = @{ +shift };
- my $installed = 0;
- my %args;
-
- _load_cpan();
- require Config;
-
- if (CPAN->VERSION < 1.80) {
- # no "sudo" support, probe for writableness
- return unless _can_write( MM->catfile( $CPAN::Config->{cpan_home}, 'sources' ) )
- and _can_write( $Config::Config{sitelib} );
- }
-
- # if we're root, set UNINST=1 to avoid trouble unless user asked for it.
- my $makeflags = $CPAN::Config->{make_install_arg} || '';
- $CPAN::Config->{make_install_arg} =
- join( ' ', split( ' ', $makeflags ), 'UNINST=1' )
- if ( $makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' } );
-
- # don't show start-up info
- $CPAN::Config->{inhibit_startup_message} = 1;
-
- # set additional options
- while ( my ( $opt, $arg ) = splice( @config, 0, 2 ) ) {
- ( $args{$opt} = $arg, next )
- if $opt =~ /^force$/; # pseudo-option
- $CPAN::Config->{$opt} = $arg;
- }
-
- local $CPAN::Config->{prerequisites_policy} = 'follow';
-
- while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
- MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall;
-
- print "*** Installing $pkg...\n";
-
- my $obj = CPAN::Shell->expand( Module => $pkg );
- my $success = 0;
-
- if ( $obj and defined( _version_check( $obj->cpan_version, $ver ) ) ) {
- my $pathname = $pkg;
- $pathname =~ s/::/\\W/;
-
- foreach my $inc ( grep { m/$pathname.pm/i } keys(%INC) ) {
- delete $INC{$inc};
- }
-
- my $rv = $args{force} ? CPAN::Shell->force( install => $pkg )
- : CPAN::Shell->install($pkg);
- $rv ||= eval {
- $CPAN::META->instance( 'CPAN::Distribution', $obj->cpan_file, )
- ->{install}
- if $CPAN::META;
- };
-
- if ( $rv eq 'YES' ) {
- print "*** $pkg successfully installed.\n";
- $success = 1;
- }
- else {
- print "*** $pkg installation failed.\n";
- $success = 0;
- }
-
- $installed += $success;
- }
- else {
- print << ".";
-*** Could not find a version $ver or above for $pkg; skipping.
-.
- }
-
- MY::postinstall( $pkg, $ver, $success ) if defined &MY::postinstall;
- }
-
- return $installed;
-}
-
-sub _has_cpanplus {
- return (
- $HasCPANPLUS = (
- $INC{'CPANPLUS/Config.pm'}
- or _load('CPANPLUS::Shell::Default')
- )
- );
-}
-
-# make guesses on whether we're under the CPAN installation directory
-sub _under_cpan {
- require Cwd;
- require File::Spec;
-
- my $cwd = File::Spec->canonpath( Cwd::cwd() );
- my $cpan = File::Spec->canonpath( $CPAN::Config->{cpan_home} );
-
- return ( index( $cwd, $cpan ) > -1 );
-}
-
-sub _update_to {
- my $class = __PACKAGE__;
- my $ver = shift;
-
- return
- if defined( _version_check( _load($class), $ver ) ); # no need to upgrade
-
- if (
- _prompt( "==> A newer version of $class ($ver) is required. Install?",
- 'y' ) =~ /^[Nn]/
- )
- {
- die "*** Please install $class $ver manually.\n";
- }
-
- print << ".";
-*** Trying to fetch it from CPAN...
-.
-
- # install ourselves
- _load($class) and return $class->import(@_)
- if $class->install( [], $class, $ver );
-
- print << '.'; exit 1;
-
-*** Cannot bootstrap myself. :-( Installation terminated.
-.
-}
-
-# check if we're connected to some host, using inet_aton
-sub _connected_to {
- my $site = shift;
-
- return (
- ( _load('Socket') and Socket::inet_aton($site) ) or _prompt(
- qq(
-*** Your host cannot resolve the domain name '$site', which
- probably means the Internet connections are unavailable.
-==> Should we try to install the required module(s) anyway?), 'n'
- ) =~ /^[Yy]/
- );
-}
-
-# check if a directory is writable; may create it on demand
-sub _can_write {
- my $path = shift;
- mkdir( $path, 0755 ) unless -e $path;
-
- return 1 if -w $path;
-
- print << ".";
-*** You are not allowed to write to the directory '$path';
- the installation may fail due to insufficient permissions.
-.
-
- if (
- eval '$>' and lc(`sudo -V`) =~ /version/ and _prompt(
- qq(
-==> Should we try to re-execute the autoinstall process with 'sudo'?),
- ((-t STDIN) ? 'y' : 'n')
- ) =~ /^[Yy]/
- )
- {
-
- # try to bootstrap ourselves from sudo
- print << ".";
-*** Trying to re-execute the autoinstall process with 'sudo'...
-.
- my $missing = join( ',', @Missing );
- my $config = join( ',',
- UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
- if $Config;
-
- return
- unless system( 'sudo', $^X, $0, "--config=$config",
- "--installdeps=$missing" );
-
- print << ".";
-*** The 'sudo' command exited with error! Resuming...
-.
- }
-
- return _prompt(
- qq(
-==> Should we try to install the required module(s) anyway?), 'n'
- ) =~ /^[Yy]/;
-}
-
-# load a module and return the version it reports
-sub _load {
- my $mod = pop; # class/instance doesn't matter
- my $file = $mod;
-
- $file =~ s|::|/|g;
- $file .= '.pm';
-
- local $@;
- return eval { require $file; $mod->VERSION } || ( $@ ? undef: 0 );
-}
-
-# Load CPAN.pm and it's configuration
-sub _load_cpan {
- return if $CPAN::VERSION;
- require CPAN;
- if ( $CPAN::HandleConfig::VERSION ) {
- # Newer versions of CPAN have a HandleConfig module
- CPAN::HandleConfig->load;
- } else {
- # Older versions had the load method in Config directly
- CPAN::Config->load;
- }
-}
-
-# compare two versions, either use Sort::Versions or plain comparison
-sub _version_check {
- my ( $cur, $min ) = @_;
- return unless defined $cur;
-
- $cur =~ s/\s+$//;
-
- # check for version numbers that are not in decimal format
- if ( ref($cur) or ref($min) or $cur =~ /v|\..*\./ or $min =~ /v|\..*\./ ) {
- if ( ( $version::VERSION or defined( _load('version') )) and
- version->can('new')
- ) {
-
- # use version.pm if it is installed.
- return (
- ( version->new($cur) >= version->new($min) ) ? $cur : undef );
- }
- elsif ( $Sort::Versions::VERSION or defined( _load('Sort::Versions') ) )
- {
-
- # use Sort::Versions as the sorting algorithm for a.b.c versions
- return ( ( Sort::Versions::versioncmp( $cur, $min ) != -1 )
- ? $cur
- : undef );
- }
-
- warn "Cannot reliably compare non-decimal formatted versions.\n"
- . "Please install version.pm or Sort::Versions.\n";
- }
-
- # plain comparison
- local $^W = 0; # shuts off 'not numeric' bugs
- return ( $cur >= $min ? $cur : undef );
-}
-
-# nothing; this usage is deprecated.
-sub main::PREREQ_PM { return {}; }
-
-sub _make_args {
- my %args = @_;
-
- $args{PREREQ_PM} = { %{ $args{PREREQ_PM} || {} }, @Existing, @Missing }
- if $UnderCPAN or $TestOnly;
-
- if ( $args{EXE_FILES} and -e 'MANIFEST' ) {
- require ExtUtils::Manifest;
- my $manifest = ExtUtils::Manifest::maniread('MANIFEST');
-
- $args{EXE_FILES} =
- [ grep { exists $manifest->{$_} } @{ $args{EXE_FILES} } ];
- }
-
- $args{test}{TESTS} ||= 't/*.t';
- $args{test}{TESTS} = join( ' ',
- grep { !exists( $DisabledTests{$_} ) }
- map { glob($_) } split( /\s+/, $args{test}{TESTS} ) );
-
- my $missing = join( ',', @Missing );
- my $config =
- join( ',', UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
- if $Config;
-
- $PostambleActions = (
- $missing
- ? "\$(PERL) $0 --config=$config --installdeps=$missing"
- : "\$(NOECHO) \$(NOOP)"
- );
-
- return %args;
-}
-
-# a wrapper to ExtUtils::MakeMaker::WriteMakefile
-sub Write {
- require Carp;
- Carp::croak "WriteMakefile: Need even number of args" if @_ % 2;
-
- if ($CheckOnly) {
- print << ".";
-*** Makefile not written in check-only mode.
-.
- return;
- }
-
- my %args = _make_args(@_);
-
- no strict 'refs';
-
- $PostambleUsed = 0;
- local *MY::postamble = \&postamble unless defined &MY::postamble;
- ExtUtils::MakeMaker::WriteMakefile(%args);
-
- print << "." unless $PostambleUsed;
-*** WARNING: Makefile written with customized MY::postamble() without
- including contents from Module::AutoInstall::postamble() --
- auto installation features disabled. Please contact the author.
-.
-
- return 1;
-}
-
-sub postamble {
- $PostambleUsed = 1;
-
- return << ".";
-
-config :: installdeps
-\t\$(NOECHO) \$(NOOP)
-
-checkdeps ::
-\t\$(PERL) $0 --checkdeps
-
-installdeps ::
-\t$PostambleActions
-
-.
-
-}
-
-1;
-
-__END__
-
-#line 1003
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/inc/Module/Install
^
|
-(directory)
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/inc/Module/Install.pm
^
|
@@ -1,281 +0,0 @@
-#line 1
-package Module::Install;
-
-# For any maintainers:
-# The load order for Module::Install is a bit magic.
-# It goes something like this...
-#
-# IF ( host has Module::Install installed, creating author mode ) {
-# 1. Makefile.PL calls "use inc::Module::Install"
-# 2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install
-# 3. The installed version of inc::Module::Install loads
-# 4. inc::Module::Install calls "require Module::Install"
-# 5. The ./inc/ version of Module::Install loads
-# } ELSE {
-# 1. Makefile.PL calls "use inc::Module::Install"
-# 2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install
-# 3. The ./inc/ version of Module::Install loads
-# }
-
-use 5.004;
-use strict 'vars';
-
-use vars qw{$VERSION};
-BEGIN {
- # All Module::Install core packages now require synchronised versions.
- # This will be used to ensure we don't accidentally load old or
- # different versions of modules.
- # This is not enforced yet, but will be some time in the next few
- # releases once we can make sure it won't clash with custom
- # Module::Install extensions.
- $VERSION = '0.67';
-}
-
-# Whether or not inc::Module::Install is actually loaded, the
-# $INC{inc/Module/Install.pm} is what will still get set as long as
-# the caller loaded module this in the documented manner.
-# If not set, the caller may NOT have loaded the bundled version, and thus
-# they may not have a MI version that works with the Makefile.PL. This would
-# result in false errors or unexpected behaviour. And we don't want that.
-my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm';
-unless ( $INC{$file} ) {
- die <<"END_DIE";
-Please invoke ${\__PACKAGE__} with:
-
- use inc::${\__PACKAGE__};
-
-not:
-
- use ${\__PACKAGE__};
-
-END_DIE
-}
-
-# If the script that is loading Module::Install is from the future,
-# then make will detect this and cause it to re-run over and over
-# again. This is bad. Rather than taking action to touch it (which
-# is unreliable on some platforms and requires write permissions)
-# for now we should catch this and refuse to run.
-if ( -f $0 and (stat($0))[9] > time ) {
- die << "END_DIE";
-Your installer $0 has a modification time in the future.
-
-This is known to create infinite loops in make.
-
-Please correct this, then run $0 again.
-
-END_DIE
-}
-
-use Cwd ();
-use File::Find ();
-use File::Path ();
-use FindBin;
-
-*inc::Module::Install::VERSION = *VERSION;
-@inc::Module::Install::ISA = __PACKAGE__;
-
-sub autoload {
- my $self = shift;
- my $who = $self->_caller;
- my $cwd = Cwd::cwd();
- my $sym = "${who}::AUTOLOAD";
- $sym->{$cwd} = sub {
- my $pwd = Cwd::cwd();
- if ( my $code = $sym->{$pwd} ) {
- # delegate back to parent dirs
- goto &$code unless $cwd eq $pwd;
- }
- $$sym =~ /([^:]+)$/ or die "Cannot autoload $who - $sym";
- unshift @_, ($self, $1);
- goto &{$self->can('call')} unless uc($1) eq $1;
- };
-}
-
-sub import {
- my $class = shift;
- my $self = $class->new(@_);
- my $who = $self->_caller;
-
- unless ( -f $self->{file} ) {
- require "$self->{path}/$self->{dispatch}.pm";
- File::Path::mkpath("$self->{prefix}/$self->{author}");
- $self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self );
- $self->{admin}->init;
- @_ = ($class, _self => $self);
- goto &{"$self->{name}::import"};
- }
-
- *{"${who}::AUTOLOAD"} = $self->autoload;
- $self->preload;
-
- # Unregister loader and worker packages so subdirs can use them again
- delete $INC{"$self->{file}"};
- delete $INC{"$self->{path}.pm"};
-}
-
-sub preload {
- my ($self) = @_;
-
- unless ( $self->{extensions} ) {
- $self->load_extensions(
- "$self->{prefix}/$self->{path}", $self
- );
- }
-
- my @exts = @{$self->{extensions}};
- unless ( @exts ) {
- my $admin = $self->{admin};
- @exts = $admin->load_all_extensions;
- }
-
- my %seen;
- foreach my $obj ( @exts ) {
- while (my ($method, $glob) = each %{ref($obj) . '::'}) {
- next unless $obj->can($method);
- next if $method =~ /^_/;
- next if $method eq uc($method);
- $seen{$method}++;
- }
- }
-
- my $who = $self->_caller;
- foreach my $name ( sort keys %seen ) {
- *{"${who}::$name"} = sub {
- ${"${who}::AUTOLOAD"} = "${who}::$name";
- goto &{"${who}::AUTOLOAD"};
- };
- }
-}
-
-sub new {
- my ($class, %args) = @_;
-
- # ignore the prefix on extension modules built from top level.
- my $base_path = Cwd::abs_path($FindBin::Bin);
- unless ( Cwd::abs_path(Cwd::cwd()) eq $base_path ) {
- delete $args{prefix};
- }
-
- return $args{_self} if $args{_self};
-
- $args{dispatch} ||= 'Admin';
- $args{prefix} ||= 'inc';
- $args{author} ||= ($^O eq 'VMS' ? '_author' : '.author');
- $args{bundle} ||= 'inc/BUNDLES';
- $args{base} ||= $base_path;
- $class =~ s/^\Q$args{prefix}\E:://;
- $args{name} ||= $class;
- $args{version} ||= $class->VERSION;
- unless ( $args{path} ) {
- $args{path} = $args{name};
- $args{path} =~ s!::!/!g;
- }
- $args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm";
-
- bless( \%args, $class );
-}
-
-sub call {
- my ($self, $method) = @_;
- my $obj = $self->load($method) or return;
- splice(@_, 0, 2, $obj);
- goto &{$obj->can($method)};
-}
-
-sub load {
- my ($self, $method) = @_;
-
- $self->load_extensions(
- "$self->{prefix}/$self->{path}", $self
- ) unless $self->{extensions};
-
- foreach my $obj (@{$self->{extensions}}) {
- return $obj if $obj->can($method);
- }
-
- my $admin = $self->{admin} or die <<"END_DIE";
-The '$method' method does not exist in the '$self->{prefix}' path!
-Please remove the '$self->{prefix}' directory and run $0 again to load it.
-END_DIE
-
- my $obj = $admin->load($method, 1);
- push @{$self->{extensions}}, $obj;
-
- $obj;
-}
-
-sub load_extensions {
- my ($self, $path, $top) = @_;
-
- unless ( grep { lc $_ eq lc $self->{prefix} } @INC ) {
- unshift @INC, $self->{prefix};
- }
-
- foreach my $rv ( $self->find_extensions($path) ) {
- my ($file, $pkg) = @{$rv};
- next if $self->{pathnames}{$pkg};
-
- local $@;
- my $new = eval { require $file; $pkg->can('new') };
- unless ( $new ) {
- warn $@ if $@;
- next;
- }
- $self->{pathnames}{$pkg} = delete $INC{$file};
- push @{$self->{extensions}}, &{$new}($pkg, _top => $top );
- }
-
- $self->{extensions} ||= [];
-}
-
-sub find_extensions {
- my ($self, $path) = @_;
-
- my @found;
- File::Find::find( sub {
- my $file = $File::Find::name;
- return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is;
- my $subpath = $1;
- return if lc($subpath) eq lc($self->{dispatch});
-
- $file = "$self->{path}/$subpath.pm";
- my $pkg = "$self->{name}::$subpath";
- $pkg =~ s!/!::!g;
-
- # If we have a mixed-case package name, assume case has been preserved
- # correctly. Otherwise, root through the file to locate the case-preserved
- # version of the package name.
- if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
- open PKGFILE, "<$subpath.pm" or die "find_extensions: Can't open $subpath.pm: $!";
- my $in_pod = 0;
- while ( <PKGFILE> ) {
- $in_pod = 1 if /^=\w/;
- $in_pod = 0 if /^=cut/;
- next if ($in_pod || /^=cut/); # skip pod text
- next if /^\s*#/; # and comments
- if ( m/^\s*package\s+($pkg)\s*;/i ) {
- $pkg = $1;
- last;
- }
- }
- close PKGFILE;
- }
-
- push @found, [ $file, $pkg ];
- }, $path ) if -d $path;
-
- @found;
-}
-
-sub _caller {
- my $depth = 0;
- my $call = caller($depth);
- while ( $call eq __PACKAGE__ ) {
- $depth++;
- $call = caller($depth);
- }
- return $call;
-}
-
-1;
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/inc/Module/Install/AutoInstall.pm
^
|
@@ -1,61 +0,0 @@
-#line 1
-package Module::Install::AutoInstall;
-
-use strict;
-use Module::Install::Base;
-
-use vars qw{$VERSION $ISCORE @ISA};
-BEGIN {
- $VERSION = '0.67';
- $ISCORE = 1;
- @ISA = qw{Module::Install::Base};
-}
-
-sub AutoInstall { $_[0] }
-
-sub run {
- my $self = shift;
- $self->auto_install_now(@_);
-}
-
-sub write {
- my $self = shift;
- $self->auto_install(@_);
-}
-
-sub auto_install {
- my $self = shift;
- return if $self->{done}++;
-
- # Flatten array of arrays into a single array
- my @core = map @$_, map @$_, grep ref,
- $self->build_requires, $self->requires;
-
- my @config = @_;
-
- # We'll need Module::AutoInstall
- $self->include('Module::AutoInstall');
- require Module::AutoInstall;
-
- Module::AutoInstall->import(
- (@config ? (-config => \@config) : ()),
- (@core ? (-core => \@core) : ()),
- $self->features,
- );
-
- $self->makemaker_args( Module::AutoInstall::_make_args() );
-
- my $class = ref($self);
- $self->postamble(
- "# --- $class section:\n" .
- Module::AutoInstall::postamble()
- );
-}
-
-sub auto_install_now {
- my $self = shift;
- $self->auto_install(@_);
- Module::AutoInstall::do_install();
-}
-
-1;
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/inc/Module/Install/Base.pm
^
|
@@ -1,70 +0,0 @@
-#line 1
-package Module::Install::Base;
-
-$VERSION = '0.67';
-
-# Suspend handler for "redefined" warnings
-BEGIN {
- my $w = $SIG{__WARN__};
- $SIG{__WARN__} = sub { $w };
-}
-
-### This is the ONLY module that shouldn't have strict on
-# use strict;
-
-#line 41
-
-sub new {
- my ($class, %args) = @_;
-
- foreach my $method ( qw(call load) ) {
- *{"$class\::$method"} = sub {
- shift()->_top->$method(@_);
- } unless defined &{"$class\::$method"};
- }
-
- bless( \%args, $class );
-}
-
-#line 61
-
-sub AUTOLOAD {
- my $self = shift;
- local $@;
- my $autoload = eval { $self->_top->autoload } or return;
- goto &$autoload;
-}
-
-#line 76
-
-sub _top { $_[0]->{_top} }
-
-#line 89
-
-sub admin {
- $_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new;
-}
-
-sub is_admin {
- $_[0]->admin->VERSION;
-}
-
-sub DESTROY {}
-
-package Module::Install::Base::FakeAdmin;
-
-my $Fake;
-sub new { $Fake ||= bless(\@_, $_[0]) }
-
-sub AUTOLOAD {}
-
-sub DESTROY {}
-
-# Restore warning handler
-BEGIN {
- $SIG{__WARN__} = $SIG{__WARN__}->();
-}
-
-1;
-
-#line 138
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/inc/Module/Install/Can.pm
^
|
@@ -1,82 +0,0 @@
-#line 1
-package Module::Install::Can;
-
-use strict;
-use Module::Install::Base;
-use Config ();
-### This adds a 5.005 Perl version dependency.
-### This is a bug and will be fixed.
-use File::Spec ();
-use ExtUtils::MakeMaker ();
-
-use vars qw{$VERSION $ISCORE @ISA};
-BEGIN {
- $VERSION = '0.67';
- $ISCORE = 1;
- @ISA = qw{Module::Install::Base};
-}
-
-# check if we can load some module
-### Upgrade this to not have to load the module if possible
-sub can_use {
- my ($self, $mod, $ver) = @_;
- $mod =~ s{::|\\}{/}g;
- $mod .= '.pm' unless $mod =~ /\.pm$/i;
-
- my $pkg = $mod;
- $pkg =~ s{/}{::}g;
- $pkg =~ s{\.pm$}{}i;
-
- local $@;
- eval { require $mod; $pkg->VERSION($ver || 0); 1 };
-}
-
-# check if we can run some command
-sub can_run {
- my ($self, $cmd) = @_;
-
- my $_cmd = $cmd;
- return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd));
-
- for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
- my $abs = File::Spec->catfile($dir, $_[1]);
- return $abs if (-x $abs or $abs = MM->maybe_command($abs));
- }
-
- return;
-}
-
-# can we locate a (the) C compiler
-sub can_cc {
- my $self = shift;
- my @chunks = split(/ /, $Config::Config{cc}) or return;
-
- # $Config{cc} may contain args; try to find out the program part
- while (@chunks) {
- return $self->can_run("@chunks") || (pop(@chunks), next);
- }
-
- return;
-}
-
-# Fix Cygwin bug on maybe_command();
-if ( $^O eq 'cygwin' ) {
- require ExtUtils::MM_Cygwin;
- require ExtUtils::MM_Win32;
- if ( ! defined(&ExtUtils::MM_Cygwin::maybe_command) ) {
- *ExtUtils::MM_Cygwin::maybe_command = sub {
- my ($self, $file) = @_;
- if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) {
- ExtUtils::MM_Win32->maybe_command($file);
- } else {
- ExtUtils::MM_Unix->maybe_command($file);
- }
- }
- }
-}
-
-1;
-
-__END__
-
-#line 157
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/inc/Module/Install/Fetch.pm
^
|
@@ -1,93 +0,0 @@
-#line 1
-package Module::Install::Fetch;
-
-use strict;
-use Module::Install::Base;
-
-use vars qw{$VERSION $ISCORE @ISA};
-BEGIN {
- $VERSION = '0.67';
- $ISCORE = 1;
- @ISA = qw{Module::Install::Base};
-}
-
-sub get_file {
- my ($self, %args) = @_;
- my ($scheme, $host, $path, $file) =
- $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
-
- if ( $scheme eq 'http' and ! eval { require LWP::Simple; 1 } ) {
- $args{url} = $args{ftp_url}
- or (warn("LWP support unavailable!\n"), return);
- ($scheme, $host, $path, $file) =
- $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
- }
-
- $|++;
- print "Fetching '$file' from $host... ";
-
- unless (eval { require Socket; Socket::inet_aton($host) }) {
- warn "'$host' resolve failed!\n";
- return;
- }
-
- return unless $scheme eq 'ftp' or $scheme eq 'http';
-
- require Cwd;
- my $dir = Cwd::getcwd();
- chdir $args{local_dir} or return if exists $args{local_dir};
-
- if (eval { require LWP::Simple; 1 }) {
- LWP::Simple::mirror($args{url}, $file);
- }
- elsif (eval { require Net::FTP; 1 }) { eval {
- # use Net::FTP to get past firewall
- my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
- $ftp->login("anonymous", 'anonymous@example.com');
- $ftp->cwd($path);
- $ftp->binary;
- $ftp->get($file) or (warn("$!\n"), return);
- $ftp->quit;
- } }
- elsif (my $ftp = $self->can_run('ftp')) { eval {
- # no Net::FTP, fallback to ftp.exe
- require FileHandle;
- my $fh = FileHandle->new;
-
- local $SIG{CHLD} = 'IGNORE';
- unless ($fh->open("|$ftp -n")) {
- warn "Couldn't open ftp: $!\n";
- chdir $dir; return;
- }
-
- my @dialog = split(/\n/, <<"END_FTP");
-open $host
-user anonymous anonymous\@example.com
-cd $path
-binary
-get $file $file
-quit
-END_FTP
- foreach (@dialog) { $fh->print("$_\n") }
- $fh->close;
- } }
- else {
- warn "No working 'ftp' program available!\n";
- chdir $dir; return;
- }
-
- unless (-f $file) {
- warn "Fetching failed: $@\n";
- chdir $dir; return;
- }
-
- return if exists $args{size} and -s $file != $args{size};
- system($args{run}) if exists $args{run};
- unlink($file) if $args{remove};
-
- print(((!exists $args{check_for} or -e $args{check_for})
- ? "done!" : "failed! ($!)"), "\n");
- chdir $dir; return !$?;
-}
-
-1;
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/inc/Module/Install/Include.pm
^
|
@@ -1,34 +0,0 @@
-#line 1
-package Module::Install::Include;
-
-use strict;
-use Module::Install::Base;
-
-use vars qw{$VERSION $ISCORE @ISA};
-BEGIN {
- $VERSION = '0.67';
- $ISCORE = 1;
- @ISA = qw{Module::Install::Base};
-}
-
-sub include {
- shift()->admin->include(@_);
-}
-
-sub include_deps {
- shift()->admin->include_deps(@_);
-}
-
-sub auto_include {
- shift()->admin->auto_include(@_);
-}
-
-sub auto_include_deps {
- shift()->admin->auto_include_deps(@_);
-}
-
-sub auto_include_dependent_dists {
- shift()->admin->auto_include_dependent_dists(@_);
-}
-
-1;
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/inc/Module/Install/Makefile.pm
^
|
@@ -1,237 +0,0 @@
-#line 1
-package Module::Install::Makefile;
-
-use strict 'vars';
-use Module::Install::Base;
-use ExtUtils::MakeMaker ();
-
-use vars qw{$VERSION $ISCORE @ISA};
-BEGIN {
- $VERSION = '0.67';
- $ISCORE = 1;
- @ISA = qw{Module::Install::Base};
-}
-
-sub Makefile { $_[0] }
-
-my %seen = ();
-
-sub prompt {
- shift;
-
- # Infinite loop protection
- my @c = caller();
- if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
- die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
- }
-
- # In automated testing, always use defaults
- if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
- local $ENV{PERL_MM_USE_DEFAULT} = 1;
- goto &ExtUtils::MakeMaker::prompt;
- } else {
- goto &ExtUtils::MakeMaker::prompt;
- }
-}
-
-sub makemaker_args {
- my $self = shift;
- my $args = ($self->{makemaker_args} ||= {});
- %$args = ( %$args, @_ ) if @_;
- $args;
-}
-
-# For mm args that take multiple space-seperated args,
-# append an argument to the current list.
-sub makemaker_append {
- my $self = sShift;
- my $name = shift;
- my $args = $self->makemaker_args;
- $args->{name} = defined $args->{$name}
- ? join( ' ', $args->{name}, @_ )
- : join( ' ', @_ );
-}
-
-sub build_subdirs {
- my $self = shift;
- my $subdirs = $self->makemaker_args->{DIR} ||= [];
- for my $subdir (@_) {
- push @$subdirs, $subdir;
- }
-}
-
-sub clean_files {
- my $self = shift;
- my $clean = $self->makemaker_args->{clean} ||= {};
- %$clean = (
- %$clean,
- FILES => join(' ', grep length, $clean->{FILES}, @_),
- );
-}
-
-sub realclean_files {
- my $self = shift;
- my $realclean = $self->makemaker_args->{realclean} ||= {};
- %$realclean = (
- %$realclean,
- FILES => join(' ', grep length, $realclean->{FILES}, @_),
- );
-}
-
-sub libs {
- my $self = shift;
- my $libs = ref $_[0] ? shift : [ shift ];
- $self->makemaker_args( LIBS => $libs );
-}
-
-sub inc {
- my $self = shift;
- $self->makemaker_args( INC => shift );
-}
-
-my %test_dir = ();
-
-sub _wanted_t {
- /\.t$/ and -f $_ and $test_dir{$File::Find::dir} = 1;
-}
-
-sub tests_recursive {
- my $self = shift;
- if ( $self->tests ) {
- die "tests_recursive will not work if tests are already defined";
- }
- my $dir = shift || 't';
- unless ( -d $dir ) {
- die "tests_recursive dir '$dir' does not exist";
- }
- require File::Find;
- %test_dir = ();
- File::Find::find( \&_wanted_t, $dir );
- $self->tests( join ' ', map { "$_/*.t" } sort keys %test_dir );
-}
-
-sub write {
- my $self = shift;
- die "&Makefile->write() takes no arguments\n" if @_;
-
- my $args = $self->makemaker_args;
- $args->{DISTNAME} = $self->name;
- $args->{NAME} = $self->module_name || $self->name || $self->determine_NAME($args);
- $args->{VERSION} = $self->version || $self->determine_VERSION($args);
- $args->{NAME} =~ s/-/::/g;
- if ( $self->tests ) {
- $args->{test} = { TESTS => $self->tests };
- }
- if ($] >= 5.005) {
- $args->{ABSTRACT} = $self->abstract;
- $args->{AUTHOR} = $self->author;
- }
- if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
- $args->{NO_META} = 1;
- }
- if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
- $args->{SIGN} = 1;
- }
- unless ( $self->is_admin ) {
- delete $args->{SIGN};
- }
-
- # merge both kinds of requires into prereq_pm
- my $prereq = ($args->{PREREQ_PM} ||= {});
- %$prereq = ( %$prereq,
- map { @$_ }
- map { @$_ }
- grep $_,
- ($self->build_requires, $self->requires)
- );
-
- # merge both kinds of requires into prereq_pm
- my $subdirs = ($args->{DIR} ||= []);
- if ($self->bundles) {
- foreach my $bundle (@{ $self->bundles }) {
- my ($file, $dir) = @$bundle;
- push @$subdirs, $dir if -d $dir;
- delete $prereq->{$file};
- }
- }
-
- if ( my $perl_version = $self->perl_version ) {
- eval "use $perl_version; 1"
- or die "ERROR: perl: Version $] is installed, "
- . "but we need version >= $perl_version";
- }
-
- $args->{INSTALLDIRS} = $self->installdirs;
-
- my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_})} keys %$args;
-
- my $user_preop = delete $args{dist}->{PREOP};
- if (my $preop = $self->admin->preop($user_preop)) {
- $args{dist} = $preop;
- }
-
- my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
- $self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile');
-}
-
-sub fix_up_makefile {
- my $self = shift;
- my $makefile_name = shift;
- my $top_class = ref($self->_top) || '';
- my $top_version = $self->_top->VERSION || '';
-
- my $preamble = $self->preamble
- ? "# Preamble by $top_class $top_version\n"
- . $self->preamble
- : '';
- my $postamble = "# Postamble by $top_class $top_version\n"
- . ($self->postamble || '');
-
- local *MAKEFILE;
- open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
- my $makefile = do { local $/; <MAKEFILE> };
- close MAKEFILE or die $!;
-
- $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
- $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
- $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
- $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m;
- $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m;
-
- # Module::Install will never be used to build the Core Perl
- # Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks
- # PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist
- $makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m;
- #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m;
-
- # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well.
- $makefile =~ s/("?)-I\$\(PERL_LIB\)\1//g;
-
- # XXX - This is currently unused; not sure if it breaks other MM-users
- # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
-
- open MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
- print MAKEFILE "$preamble$makefile$postamble" or die $!;
- close MAKEFILE or die $!;
-
- 1;
-}
-
-sub preamble {
- my ($self, $text) = @_;
- $self->{preamble} = $text . $self->{preamble} if defined $text;
- $self->{preamble};
-}
-
-sub postamble {
- my ($self, $text) = @_;
- $self->{postamble} ||= $self->admin->postamble;
- $self->{postamble} .= $text if defined $text;
- $self->{postamble}
-}
-
-1;
-
-__END__
-
-#line 363
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/inc/Module/Install/Metadata.pm
^
|
@@ -1,336 +0,0 @@
-#line 1
-package Module::Install::Metadata;
-
-use strict 'vars';
-use Module::Install::Base;
-
-use vars qw{$VERSION $ISCORE @ISA};
-BEGIN {
- $VERSION = '0.67';
- $ISCORE = 1;
- @ISA = qw{Module::Install::Base};
-}
-
-my @scalar_keys = qw{
- name module_name abstract author version license
- distribution_type perl_version tests installdirs
-};
-
-my @tuple_keys = qw{
- build_requires requires recommends bundles
-};
-
-sub Meta { shift }
-sub Meta_ScalarKeys { @scalar_keys }
-sub Meta_TupleKeys { @tuple_keys }
-
-foreach my $key (@scalar_keys) {
- *$key = sub {
- my $self = shift;
- return $self->{values}{$key} if defined wantarray and !@_;
- $self->{values}{$key} = shift;
- return $self;
- };
-}
-
-foreach my $key (@tuple_keys) {
- *$key = sub {
- my $self = shift;
- return $self->{values}{$key} unless @_;
-
- my @rv;
- while (@_) {
- my $module = shift or last;
- my $version = shift || 0;
- if ( $module eq 'perl' ) {
- $version =~ s{^(\d+)\.(\d+)\.(\d+)}
- {$1 + $2/1_000 + $3/1_000_000}e;
- $self->perl_version($version);
- next;
- }
- my $rv = [ $module, $version ];
- push @rv, $rv;
- }
- push @{ $self->{values}{$key} }, @rv;
- @rv;
- };
-}
-
-# configure_requires is currently a null-op
-sub configure_requires { 1 }
-
-# Aliases for build_requires that will have alternative
-# meanings in some future version of META.yml.
-sub test_requires { shift->build_requires(@_) }
-sub install_requires { shift->build_requires(@_) }
-
-# Aliases for installdirs options
-sub install_as_core { $_[0]->installdirs('perl') }
-sub install_as_cpan { $_[0]->installdirs('site') }
-sub install_as_site { $_[0]->installdirs('site') }
-sub install_as_vendor { $_[0]->installdirs('vendor') }
-
-sub sign {
- my $self = shift;
- return $self->{'values'}{'sign'} if defined wantarray and ! @_;
- $self->{'values'}{'sign'} = ( @_ ? $_[0] : 1 );
- return $self;
-}
-
-sub dynamic_config {
- my $self = shift;
- unless ( @_ ) {
- warn "You MUST provide an explicit true/false value to dynamic_config, skipping\n";
- return $self;
- }
- $self->{'values'}{'dynamic_config'} = $_[0] ? 1 : 0;
- return $self;
-}
-
-sub all_from {
- my ( $self, $file ) = @_;
-
- unless ( defined($file) ) {
- my $name = $self->name
- or die "all_from called with no args without setting name() first";
- $file = join('/', 'lib', split(/-/, $name)) . '.pm';
- $file =~ s{.*/}{} unless -e $file;
- die "all_from: cannot find $file from $name" unless -e $file;
- }
-
- $self->version_from($file) unless $self->version;
- $self->perl_version_from($file) unless $self->perl_version;
-
- # The remaining probes read from POD sections; if the file
- # has an accompanying .pod, use that instead
- my $pod = $file;
- if ( $pod =~ s/\.pm$/.pod/i and -e $pod ) {
- $file = $pod;
- }
-
- $self->author_from($file) unless $self->author;
- $self->license_from($file) unless $self->license;
- $self->abstract_from($file) unless $self->abstract;
-}
-
-sub provides {
- my $self = shift;
- my $provides = ( $self->{values}{provides} ||= {} );
- %$provides = (%$provides, @_) if @_;
- return $provides;
-}
-
-sub auto_provides {
- my $self = shift;
- return $self unless $self->is_admin;
-
- unless (-e 'MANIFEST') {
- warn "Cannot deduce auto_provides without a MANIFEST, skipping\n";
- return $self;
- }
-
- # Avoid spurious warnings as we are not checking manifest here.
-
- local $SIG{__WARN__} = sub {1};
- require ExtUtils::Manifest;
- local *ExtUtils::Manifest::manicheck = sub { return };
-
- require Module::Build;
- my $build = Module::Build->new(
- dist_name => $self->name,
- dist_version => $self->version,
- license => $self->license,
- );
- $self->provides(%{ $build->find_dist_packages || {} });
-}
-
-sub feature {
- my $self = shift;
- my $name = shift;
- my $features = ( $self->{values}{features} ||= [] );
-
- my $mods;
-
- if ( @_ == 1 and ref( $_[0] ) ) {
- # The user used ->feature like ->features by passing in the second
- # argument as a reference. Accomodate for that.
- $mods = $_[0];
- } else {
- $mods = \@_;
- }
-
- my $count = 0;
- push @$features, (
- $name => [
- map {
- ref($_) ? ( ref($_) eq 'HASH' ) ? %$_
- : @$_
- : $_
- } @$mods
- ]
- );
-
- return @$features;
-}
-
-sub features {
- my $self = shift;
- while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) {
- $self->feature( $name, @$mods );
- }
- return $self->{values}->{features}
- ? @{ $self->{values}->{features} }
- : ();
-}
-
-sub no_index {
- my $self = shift;
- my $type = shift;
- push @{ $self->{values}{no_index}{$type} }, @_ if $type;
- return $self->{values}{no_index};
-}
-
-sub read {
- my $self = shift;
- $self->include_deps( 'YAML', 0 );
-
- require YAML;
- my $data = YAML::LoadFile('META.yml');
-
- # Call methods explicitly in case user has already set some values.
- while ( my ( $key, $value ) = each %$data ) {
- next unless $self->can($key);
- if ( ref $value eq 'HASH' ) {
- while ( my ( $module, $version ) = each %$value ) {
- $self->can($key)->($self, $module => $version );
- }
- }
- else {
- $self->can($key)->($self, $value);
- }
- }
- return $self;
-}
-
-sub write {
- my $self = shift;
- return $self unless $self->is_admin;
- $self->admin->write_meta;
- return $self;
-}
-
-sub version_from {
- my ( $self, $file ) = @_;
- require ExtUtils::MM_Unix;
- $self->version( ExtUtils::MM_Unix->parse_version($file) );
-}
-
-sub abstract_from {
- my ( $self, $file ) = @_;
- require ExtUtils::MM_Unix;
- $self->abstract(
- bless(
- { DISTNAME => $self->name },
- 'ExtUtils::MM_Unix'
- )->parse_abstract($file)
- );
-}
-
-sub _slurp {
- my ( $self, $file ) = @_;
-
- local *FH;
- open FH, "< $file" or die "Cannot open $file.pod: $!";
- do { local $/; <FH> };
-}
-
-sub perl_version_from {
- my ( $self, $file ) = @_;
-
- if (
- $self->_slurp($file) =~ m/
- ^
- use \s*
- v?
- ([\d_\.]+)
- \s* ;
- /ixms
- )
- {
- my $v = $1;
- $v =~ s{_}{}g;
- $self->perl_version($1);
- }
- else {
- warn "Cannot determine perl version info from $file\n";
- return;
- }
-}
-
-sub author_from {
- my ( $self, $file ) = @_;
- my $content = $self->_slurp($file);
- if ($content =~ m/
- =head \d \s+ (?:authors?)\b \s*
- ([^\n]*)
- |
- =head \d \s+ (?:licen[cs]e|licensing|copyright|legal)\b \s*
- .*? copyright .*? \d\d\d[\d.]+ \s* (?:\bby\b)? \s*
- ([^\n]*)
- /ixms) {
- my $author = $1 || $2;
- $author =~ s{E<lt>}{<}g;
- $author =~ s{E<gt>}{>}g;
- $self->author($author);
- }
- else {
- warn "Cannot determine author info from $file\n";
- }
-}
-
-sub license_from {
- my ( $self, $file ) = @_;
-
- if (
- $self->_slurp($file) =~ m/
- (
- =head \d \s+
- (?:licen[cs]e|licensing|copyright|legal)\b
- .*?
- )
- (=head\\d.*|=cut.*|)
- \z
- /ixms
- )
- {
- my $license_text = $1;
- my @phrases = (
- 'under the same (?:terms|license) as perl itself' => 'perl', 1,
- 'GNU public license' => 'gpl', 1,
- 'GNU lesser public license' => 'gpl', 1,
- 'BSD license' => 'bsd', 1,
- 'Artistic license' => 'artistic', 1,
- 'GPL' => 'gpl', 1,
- 'LGPL' => 'lgpl', 1,
- 'BSD' => 'bsd', 1,
- 'Artistic' => 'artistic', 1,
- 'MIT' => 'mit', 1,
- 'proprietary' => 'proprietary', 0,
- );
- while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
- $pattern =~ s{\s+}{\\s+}g;
- if ( $license_text =~ /\b$pattern\b/i ) {
- if ( $osi and $license_text =~ /All rights reserved/i ) {
- warn "LEGAL WARNING: 'All rights reserved' may invalidate Open Source licenses. Consider removing it.";
- }
- $self->license($license);
- return 1;
- }
- }
- }
-
- warn "Cannot determine license info from $file\n";
- return 'unknown';
-}
-
-1;
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/inc/Module/Install/Win32.pm
^
|
@@ -1,65 +0,0 @@
-#line 1
-package Module::Install::Win32;
-
-use strict;
-use Module::Install::Base;
-
-use vars qw{$VERSION $ISCORE @ISA};
-BEGIN {
- $VERSION = '0.67';
- $ISCORE = 1;
- @ISA = qw{Module::Install::Base};
-}
-
-# determine if the user needs nmake, and download it if needed
-sub check_nmake {
- my $self = shift;
- $self->load('can_run');
- $self->load('get_file');
-
- require Config;
- return unless (
- $^O eq 'MSWin32' and
- $Config::Config{make} and
- $Config::Config{make} =~ /^nmake\b/i and
- ! $self->can_run('nmake')
- );
-
- print "The required 'nmake' executable not found, fetching it...\n";
-
- require File::Basename;
- my $rv = $self->get_file(
- url => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe',
- ftp_url => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe',
- local_dir => File::Basename::dirname($^X),
- size => 51928,
- run => 'Nmake15.exe /o > nul',
- check_for => 'Nmake.exe',
- remove => 1,
- );
-
- if (!$rv) {
- die <<'END_MESSAGE';
-
--------------------------------------------------------------------------------
-
-Since you are using Microsoft Windows, you will need the 'nmake' utility
-before installation. It's available at:
-
- http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe
- or
- ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe
-
-Please download the file manually, save it to a directory in %PATH% (e.g.
-C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to
-that directory, and run "Nmake15.exe" from there; that will create the
-'nmake.exe' file needed by this module.
-
-You may then resume the installation process described in README.
-
--------------------------------------------------------------------------------
-END_MESSAGE
- }
-}
-
-1;
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/inc/Module/Install/WriteAll.pm
^
|
@@ -1,43 +0,0 @@
-#line 1
-package Module::Install::WriteAll;
-
-use strict;
-use Module::Install::Base;
-
-use vars qw{$VERSION $ISCORE @ISA};
-BEGIN {
- $VERSION = '0.67';
- $ISCORE = 1;
- @ISA = qw{Module::Install::Base};
-}
-
-sub WriteAll {
- my $self = shift;
- my %args = (
- meta => 1,
- sign => 0,
- inline => 0,
- check_nmake => 1,
- @_
- );
-
- $self->sign(1) if $args{sign};
- $self->Meta->write if $args{meta};
- $self->admin->WriteAll(%args) if $self->is_admin;
-
- if ( $0 =~ /Build.PL$/i ) {
- $self->Build->write;
- } else {
- $self->check_nmake if $args{check_nmake};
- unless ( $self->makemaker_args->{'PL_FILES'} ) {
- $self->makemaker_args( PL_FILES => {} );
- }
- if ($args{inline}) {
- $self->Inline->write;
- } else {
- $self->Makefile->write;
- }
- }
-}
-
-1;
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/t/02-kwalitee.t
^
|
@@ -1,4 +0,0 @@
-use Test::More;
-
-eval { require Test::Kwalitee; Test::Kwalitee->import() };
-plan( skip_all => 'Test::Kwalitee not installed; skipping' ) if $@;
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/t/02-pod-coverage.t
^
|
@@ -1,6 +0,0 @@
-use Test::More;
-
-plan skip_all => 'Test::Pod::Coverage disabled. TEST_POD_COVERAGE=1 if you want it.' unless $ENV{TEST_POD_COVERAGE};
-eval "use Test::Pod::Coverage 1.00";
-plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@;
-all_pod_coverage_ok();
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/t/02-pod.t
^
|
@@ -1,6 +0,0 @@
-use strict;
-use Test::More;
-eval "use Test::Pod 1.00";
-plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
-my @poddirs = qw( lib ); # Should probably be blib...
-all_pod_files_ok( all_pod_files( @poddirs ) );
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/t/99-prepare.t
^
|
@@ -1,14 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-use warnings;
-use Test::More tests => 1;
-
-# TBone used to do this, but thankfully, we've done away with that
-my $output_dir = './testout';
-if( ! -d $output_dir ) {
- mkdir $output_dir or warn "Could not make output directory: $!"
-}
-
-ok( -d $output_dir, "$output_dir exists" );
-
-1;
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/t/BodyPrint.t
^
|
@@ -1,30 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-use warnings;
-use Test::More tests => 7;
-
-use MIME::Body;
-use MIME::Tools;
-
-my $body = MIME::Body::InCore->new("hi\n");
-my $fh = $body->open("r");
-my @ary = <$fh>;
-$fh->close();
-is(scalar(@ary), 1);
-is($ary[0], "hi\n");
-
-$body = MIME::Body::InCore->new(\"hi\n");
-$fh = $body->open("r");
-@ary = <$fh>;
-$fh->close();
-is(scalar(@ary), 1);
-is($ary[0], "hi\n");
-
-$body = MIME::Body::InCore->new(["line 1\n", "line 2\n"]);
-$fh = $body->open("r");
-@ary = <$fh>;
-$fh->close();
-is(scalar(@ary), 2);
-is($ary[0], "line 1\n");
-is($ary[1], "line 2\n");
-
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/t/Smtpsend.t
^
|
@@ -1,99 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-use warnings;
-use Test::More tests => 9;
-
-use MIME::Tools;
-use MIME::Entity;
-
-use IO::Socket::INET;
-
-# Listen on port 5225 to pretend to be an SMTP server
-my $sock = IO::Socket::INET->new(Listen => 5,
- LocalPort => 5225,
- ReuseAddr => 1,
- Type => SOCK_STREAM,
- Timeout => 10,
- Proto => 'tcp');
-
-die("can't create socket: $!") unless $sock;
-
-my $top = MIME::Entity->build(
- Type => 'multipart/mixed',
- From => 'devnull@roaringpenguin.com',
- To => 'devnull@roaringpenguin.com',
- Subject => 'smtpsend test');
-$top->attach(
- Data => 'plain',
- Type => 'text/plain');
-
-my $pid = fork();
-if (!defined($pid)) {
- die("fork() failed: $!");
-}
-
-if (!$pid) {
- # In the child
- $top->smtpsend(Host => '127.0.0.1',
- Port => 5225);
- exit(0);
-}
-
-# In the parent
-my $s = $sock->accept();
-if (!$s) {
- kill(9, $pid);
- die("accept failed: $!");
-}
-
-$s->print("220 Go ahead\n");
-$s->flush();
-my $line = $s->getline();
-like($line, qr/^EHLO/i);
-$s->print("220 Hi there\n");
-$s->flush();
-
-$line = $s->getline();
-like($line, qr/^MAIL/i);
-$s->print("220 OK\n");
-$s->flush();
-
-$line = $s->getline();
-like($line, qr/^RCPT/i);
-$s->print("220 OK\n");
-$s->flush();
-
-$line = $s->getline();
-like($line, qr/^DATA/i);
-$s->print("311 Send it\n");
-$s->flush();
-
-my $body = '';
-while(<$s>) {
- last if ($_ =~ /^\./);
- $body .= $_;
-}
-
-$s->print("220 Got it all; thanks\n");
-$s->flush();
-
-$line = $s->getline();
-like($line, qr/^QUIT/i);
-$s->print("220 See ya\n");
-$s->flush();
-$s->close();
-
-my @lines = split("\n", $body);
-
-# Get the end of headers
-while($lines[0] ne "\r") {
- shift(@lines);
-}
-shift(@lines);
-
-is(scalar(@lines), 9);
-is($lines[0], "This is a multi-part message in MIME format...\r");
-is($lines[3], "Content-Type: text/plain\r");
-is($lines[7], "plain\r");
-
-
|
[-]
[+]
|
Deleted |
MIME-tools-5.426.tar.bz2/t/WordEncoder.t
^
|
@@ -1,27 +0,0 @@
-use strict;
-use warnings;
-use Test::More tests => 8;
-use MIME::Words qw(:all);
-
-is(encode_mimeword('wookie', 'Q', 'ISO-8859-1'),
- '=?ISO-8859-1?Q?wookie?=');
-is(encode_mimeword('François', 'Q', 'ISO-8859-1'),
- '=?ISO-8859-1?Q?Fran=E7ois?=');
-is(encode_mimewords('Me and François'), '=?ISO-8859-1?Q?Me=20and=20Fran=E7ois?=');
-is(decode_mimewords('=?ISO-8859-1?Q?Me=20and=20Fran=E7ois?='),
- 'Me and François');
-
-is(encode_mimewords('Me and François and François and François and François and François and François'),
- '=?ISO-8859-1?Q?Me=20and=20Fran=E7ois=20an?= =?ISO-8859-1?Q?d=20Fran=E7ois=20=20=20=20and=20?= =?ISO-8859-1?Q?Fran=E7ois=20=20=20=20=20=20=20and?= =?ISO-8859-1?Q?=20Fran=E7ois=20=20=20=20=20=20=20=20=20?= =?ISO-8859-1?Q?=20=20=20=20=20=20and=20Fran=E7ois?= =?ISO-8859-1?Q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?ISO-8859-1?Q?=20=20=20=20and=20Fran=E7ois?=');
-
-
-is(decode_mimewords('=?ISO-8859-1?Q?Me=20and=20Fran=E7ois=20an?= =?ISO-8859-1?Q?d=20Fran=E7ois=20=20=20=20and=20?= =?ISO-8859-1?Q?Fran=E7ois=20=20=20=20=20=20=20and?= =?ISO-8859-1?Q?=20Fran=E7ois=20=20=20=20=20=20=20=20=20?= =?ISO-8859-1?Q?=20=20=20=20=20=20and=20Fran=E7ois?= =?ISO-8859-1?Q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?ISO-8859-1?Q?=20=20=20=20and=20Fran=E7ois?='),
- 'Me and François and François and François and François and François and François');
-
-
-is(encode_mimewords('Me and François and François and François and François and François and François and wookie and wookie and wookie and wookie and wookie and wookie'),
- '=?ISO-8859-1?Q?Me=20and=20Fran=E7ois=20an?= =?ISO-8859-1?Q?d=20Fran=E7ois=20=20=20=20and=20?= =?ISO-8859-1?Q?Fran=E7ois=20=20=20=20=20=20=20and?= =?ISO-8859-1?Q?=20Fran=E7ois=20=20=20=20=20=20=20=20=20?= =?ISO-8859-1?Q?=20=20=20=20=20=20and=20Fran=E7ois?= =?ISO-8859-1?Q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?ISO-8859-1?Q?=20=20=20=20and=20Fran=E7ois=20a?=nd wookie and wookie and wookie and wookie and wookie and wookie');
-
-is(decode_mimewords('=?ISO-8859-1?Q?Me=20and=20Fran=E7ois=20an?= =?ISO-8859-1?Q?d=20Fran=E7ois=20=20=20=20and=20?= =?ISO-8859-1?Q?Fran=E7ois=20=20=20=20=20=20=20and?= =?ISO-8859-1?Q?=20Fran=E7ois=20=20=20=20=20=20=20=20=20?= =?ISO-8859-1?Q?=20=20=20=20=20=20and=20Fran=E7ois?= =?ISO-8859-1?Q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?ISO-8859-1?Q?=20=20=20=20and=20Fran=E7ois=20a?=nd wookie and wookie and wookie and wookie and wookie and wookie'),
- 'Me and François and François and François and François and François and François and wookie and wookie and wookie and wookie and wookie and wookie');
-
|
|
Deleted |
MIME-tools-5.427.tar.gz
^
|