[prev in list] [next in list] [prev in thread] [next in thread]
List: perl-mailbox
Subject: Mail::Box release 2.022: PLEASE READ
From: Mark Overmeer <Mark () Overmeer ! net>
Date: 2002-09-09 16:25:12
[Download RAW message or body]
= Mail::Box release 2.022 [PLEASE READ CAREFULLY]
It took me a bit more time for this release than usual, mainly because
there are quite some large internal modifications. May be someone is
willing to compare the speed of this release with the previous?
Memory consumption should be down quite a lot, since I reduced the
storage need for header fields.
I am working on two things: improving the documentation, and checks
against RFC2822. The latter required some minor changes in the API.
Sorry for the inconvenience.
= CHANGES IN THE API
- $msg->from returns a list now. Be careful with scalar context!
- A field stringifies to "body; comment", not only to "body"
For instance,
my $field = Mail::Message::Field
->new('Content-Type: text/html; charset="us-ascii"');
print "$field" returned "text/html" # old behavior
now it returns "text/html; charset="us-ascii"; # new
print $field->body; # text/html (unchanged)
print $field->comment; # charset="us-ascii" (unchanged)
- For the same reason, $body->type returns the whole body/comment
content of the Content-Type field, not only the body. Use
$msg->mimeType to get only the body. You may have to change:
if($msg->type eq 'text/html') # not correct anymore
into if($msg->mimeType eq 'text/html')
The latter has many advantages being case-insensitive and such,
because it uses a MIME::Type object, not the Mail::Message::Field
object, to do the comparison.
= FIXES
Darrell Fuhriman, Swapnil Khabiya, and Jon Thomason found small
problems with the previous release. They have been fixed.
= IMPROVEMENTS
Many changes have been made in the way headers and fields are handled. The
order of header lines is kept very strictly, which is wished for by the
RFC, and needed for correct grouping of resent lines. For this, I have
implemented the Mail::Message::Head::ResentGroup objects which maintain
groups of 'Return-Path', 'Received', and 'Resent-.*' lines. They can
be managed as a set (for instance deleted all together)
$msg->to, $msg->from, a.o. do not look at the Resent-* headers anymore
[thanks to Jost Krieger and the RFC]
= NEXT
There are many more changes and improvements, which can be found in the
attached ChangeLog extract. My RFC2822 check is not yet completed.
Next release will have improved handling of CFWS (comments/folding
white spaces) in structured header fields. There is use for a
Mail::Message::Head::ListGroup class, and some more groups.
Please help me by sending bug-reports.
--
Enjoy,
MarkOv %-]
------------------------------------------------------------------------
drs Mark A.C.J. Overmeer MARKOV Solutions
Mark@Overmeer.net solutions@overmeer.net
http://Mark.Overmeer.net http://solutions.overmeer.net
version 2.022: Mon Sep 9 18:55:01 CEST 2002
Detailed checks against RFC2822 is in progress, which means that
some changes have to be made. The API had to be changed on some
places, but on most places could be kept unchanged.
Application breakers:
- $msg->from now returns a list fo addresses! Mind the context!
required by the RFC.
- stringified $body->type returns whole Content-Type body. Use
$body->mimeType! Example:
if($msg->type eq 'text/html') # breaks now
if($msg->mimeType eq 'text/html') # works as always
- a header field stringifies to "body; comment", not only
the body.
Fixes:
- Messages which of unknown Content-Type (unknown by MIME::Types)
could cause segmentation violates. Solved by [Darrell Fuhriman]
- In Mail::Box::Manager, the method foldertypes() was called, which
should have been folderTypes(). [Swapnil Khabiya]
- Mail::Message::Construct::replyPrelude produced warning when
from address of originating message dit not defined a user's
name. Now it has a fallback. Reported by [Jon Thomason]
Improvements:
- new method Mail::Box::Message::moveTo()
- new method Mail::Message::sender()
- Mail::Message::Convert::selectedFields() retuns fields now
(in the right order), not field names.
- Mail::Reporter::log() now also as class method.
- Mail::Reporter::defaultTrace() to set program global defaults
for logging and tracing.
- New class Mail::Message::Head::ResentGroup with tests in
t/12head1r.t
- Mali::Message::Construct::printStructure now accepts a filehandle.
- reply() takes return address from: Reply-To || Sender || From
(Sender added)
I have re-read specification rfc2822, and reimplemented the three
Mail::Message::Field* objects. The next changes are made to
these objects:
- field data is only stored in folded form to improve performance
during parsing and reduce memory consumption (which is quite
high for headers) but also to be able to handle structured fields
better. This introduced two new methods:
folded_body()
unfolded_body()
The body(), comment(), and content() are quite different now,
although return the same results.
- toDate() without argument returns an rfc2822 valid date
representing the current local time.
- new() accepts attributes. The OPTIONS are only available
for ::Flex fields.
- attributes handle escapes of quotes in quoted strings.
- new method length() which returns the total field length.
- new method toDisclose() which tells
Mail::Message::Head::printUndisclosed whether the header should
be visible for extenal receivers.
- new method stripCFWS() removes comments and folding white space from
header lines. This should only be used on structured header
fields. Tests in t/11cfws.t
- new method dateToTimestamp converts a date in RFC2822 spec into
a timestamp.
Also Mail::Message::Head got revisited. The order of the fields
is protected stronger.
- new method orderedFields()
- new method addResentGroup()
- new method resentGroups()
- new method removeField($field)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic