r58673 - in /trunk/libmail-imapclient-perl: Changes MANIFEST META.yml Makefile.PL debian/changelog debian/copyright examples/idle.pl lib/Mail/IMAPClient.pm lib/Mail/IMAPClient/BodyStructure.pm t/basic.t t/body_string.t t/bodystructure.t
ansgar-guest at users.alioth.debian.org
ansgar-guest at users.alioth.debian.org
Mon May 31 04:53:29 UTC 2010
Author: ansgar-guest
Date: Mon May 31 04:53:17 2010
New Revision: 58673
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=58673
Log:
* New upstream release.
* debian/copyright: Update upstream maintainer.
Added:
trunk/libmail-imapclient-perl/examples/idle.pl
- copied unchanged from r58671, branches/upstream/libmail-imapclient-perl/current/examples/idle.pl
trunk/libmail-imapclient-perl/t/body_string.t
- copied unchanged from r58671, branches/upstream/libmail-imapclient-perl/current/t/body_string.t
Modified:
trunk/libmail-imapclient-perl/Changes
trunk/libmail-imapclient-perl/MANIFEST
trunk/libmail-imapclient-perl/META.yml
trunk/libmail-imapclient-perl/Makefile.PL
trunk/libmail-imapclient-perl/debian/changelog
trunk/libmail-imapclient-perl/debian/copyright
trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pm
trunk/libmail-imapclient-perl/lib/Mail/IMAPClient/BodyStructure.pm
trunk/libmail-imapclient-perl/t/basic.t
trunk/libmail-imapclient-perl/t/bodystructure.t
Modified: trunk/libmail-imapclient-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/Changes?rev=58673&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/Changes (original)
+++ trunk/libmail-imapclient-perl/Changes Mon May 31 04:53:17 2010
@@ -4,6 +4,21 @@
Changes from 2.99_01 to 3.16 made by Mark Overmeer
Changes from 0.09 to 2.99_01 made by David Kernen
- Potential compatibility issues from 3.17+ highlighted with '*'
+
+version 3.25: Fri May 28 00:07:40 EDT 2010
+ - fix body_string parsing bug and added tests in t/body_string.t
+ [Heiko Schlittermann]
+ - rt.cpan.org#57661: uninitialized value warning in IMAPClient::thread
+ [Max Bowsher]
+ - rt.cpan.org#57337: Correctly handle multiparts in BodyStructure.pm
+ [Robert Norris]
+ fixes in Mail::IMAPClient::BodyStructure::bodystructure for
+ bugs still in release 3.24
+ - rt.cpan.org#57659: install fails when using cPanel GUI
+ [Ken Parisi]
+ hack Makefile.PL to use alarm() and timeout prompt() gracefully
+ - relax t/basic.t logout() error check (allow 'BYE' instead of 'OK')
+ - left examples/idle.pl out of MANIFEST for 3.24
version 3.24: Fri May 7 17:02:35 EDT 2010
- rt.cpan.org#48912: wrong part numbers in multipart messages
Modified: trunk/libmail-imapclient-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/MANIFEST?rev=58673&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/MANIFEST (original)
+++ trunk/libmail-imapclient-perl/MANIFEST Mon May 31 04:53:17 2010
@@ -12,6 +12,7 @@
examples/cyrus_expire.pl
examples/cyrus_expunge.pl
examples/find_dup_msgs.pl
+examples/idle.pl
examples/imap_to_mbox.pl
examples/imtestExample.pl
examples/migrate_mail2.pl
@@ -31,6 +32,7 @@
prepare_dist
sample.perldb
t/basic.t
+t/body_string.t
t/bodystructure.t
t/fetch_hash.t
t/messageset.t
Modified: trunk/libmail-imapclient-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/META.yml?rev=58673&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/META.yml (original)
+++ trunk/libmail-imapclient-perl/META.yml Mon May 31 04:53:17 2010
@@ -1,9 +1,9 @@
--- #YAML:1.0
name: Mail-IMAPClient
-version: 3.24
+version: 3.25
abstract: IMAP4 client library
author:
- - Phil Lobbes <phil at zimbra.com>
+ - Phil Pearl (Lobbes) <phil at zimbra.com>
license: unknown
distribution_type: module
configure_requires:
Modified: trunk/libmail-imapclient-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/Makefile.PL?rev=58673&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/Makefile.PL (original)
+++ trunk/libmail-imapclient-perl/Makefile.PL Mon May 31 04:53:17 2010
@@ -56,7 +56,7 @@
clean => { FILES => 'test.txt' },
$] >= 5.005
? ## keywords supported since 5.005
- ( AUTHOR => 'Phil Lobbes <phil at zimbra.com>' )
+ ( AUTHOR => 'Phil Pearl (Lobbes) <phil at zimbra.com>' )
: ()
);
@@ -74,17 +74,28 @@
return;
}
- return if -f "./test.txt";
+ return if -s "./test.txt";
print <<'__INTRO';
You have the option of running an extended suite of tests during
'make test'. This requires an IMAP server name, user account, and
password to test with.
+Note: this prompt will automatically timeout after 60 seconds.
+
__INTRO
- my $yes = prompt "Do you want to run the extended tests? (n/y)";
- return if $yes !~ /^y(?:es)?$/i;
+ # HACK: alarm() allows broken interfaces to timeout gracefully...
+ # - rt.cpan.org#57659: install fails when using cPanel GUI
+ my $yes;
+ eval {
+ local $SIG{ALRM} = sub { die "alarm\n" };
+ alarm(60);
+ $yes = prompt "Do you want to run the extended tests? (n/y)";
+ alarm(0);
+ };
+ print "\n" if $@;
+ return unless ( $yes and $yes =~ /^y(?:es)?$/i );
unless ( open TST, '>', "./test.txt" ) {
warn "ERROR: couldn't open ./test.txt: $!\n";
Modified: trunk/libmail-imapclient-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/debian/changelog?rev=58673&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/debian/changelog (original)
+++ trunk/libmail-imapclient-perl/debian/changelog Mon May 31 04:53:17 2010
@@ -1,3 +1,10 @@
+libmail-imapclient-perl (3.25-1) unstable; urgency=low
+
+ * New upstream release.
+ * debian/copyright: Update upstream maintainer.
+
+ -- Ansgar Burchardt <ansgar at 43-1.org> Mon, 31 May 2010 13:52:56 +0900
+
libmail-imapclient-perl (3.24-1) unstable; urgency=low
* New upstream release.
Modified: trunk/libmail-imapclient-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/debian/copyright?rev=58673&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/debian/copyright (original)
+++ trunk/libmail-imapclient-perl/debian/copyright Mon May 31 04:53:17 2010
@@ -1,9 +1,8 @@
Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=59
Name: Mail-IMAPClient
-Maintainer: Phil Pearl <phil at perkpartners.com>
+Maintainer: Phil Pearl (Lobbes) <phil at zimbra.com>
Source: http://search.cpan.org/dist/Mail-IMAPClient/
-Files: *
Copyright: 2010, Phil Pearl <phil at perkpartners.com>
2007-2009, Mark Overmeer <mark at overmeer.net>
1999-2002, The Kernen Group, Inc.
Modified: trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pm?rev=58673&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pm (original)
+++ trunk/libmail-imapclient-perl/lib/Mail/IMAPClient.pm Mon May 31 04:53:17 2010
@@ -5,7 +5,7 @@
use warnings;
package Mail::IMAPClient;
-our $VERSION = '3.24';
+our $VERSION = '3.25';
use Mail::IMAPClient::MessageSet;
@@ -1191,9 +1191,9 @@
}
my $popped;
- $popped = pop @$ref # (-: vi
- until ( $popped && $popped =~ /\)$CRLF$/o ) # (-: vi
- || !grep /\)$CRLF$/o, @$ref;
+ $popped = pop @$ref
+ until ( $popped && $popped =~ /^\)$CRLF$/o )
+ || !grep /^\)$CRLF$/o, @$ref;
if ( $head =~ /BODY\[TEXT\]\s*$/i ) { # Next line is a literal
$string .= shift @$ref while @$ref;
@@ -2697,7 +2697,7 @@
or return undef;
unless ($thread_parser) {
- return if $thread_parser == 0;
+ return if ( defined($thread_parser) and $thread_parser == 0 );
my $class = $self->_load_module("Thread");
unless ($class) {
Modified: trunk/libmail-imapclient-perl/lib/Mail/IMAPClient/BodyStructure.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/lib/Mail/IMAPClient/BodyStructure.pm?rev=58673&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/lib/Mail/IMAPClient/BodyStructure.pm (original)
+++ trunk/libmail-imapclient-perl/lib/Mail/IMAPClient/BodyStructure.pm Mon May 31 04:53:17 2010
@@ -106,17 +106,26 @@
my $prefix = $self->{_prefix} || "";
$prefix =~ s/\.?$/./;
- # in a multipart message each subpart is one level "higher"
- $prefix =~ s/\.\d+\.$/./ if ($self->{bodytype} eq 'MULTIPART');
-
foreach my $p ( @{$self->{bodystructure}} )
{ $partno++;
- $p->{_prefix} = "$prefix$partno";
-
# BUG?: old code didn't add .TEXT sections, should we skip these?
- my $pno = $partno;
- $pno = "TEXT" if ($partno == 1 and $self->{bodytype} eq 'MESSAGE');
+ # - This code needs to be generalised (maybe it belongs in parts()?)
+ # - Should every message should have HEAD (actually MIME) and TEXT?
+ # at least dovecot and iplanet appear to allow this even for
+ # non-multipart sections
+ my $pno = $partno;
+ my $stype = $self->{bodytype} || "";
+ my $ptype = $p->{bodytype} || "";
+
+ # a message and the multipart inside of it "collapse together"
+ if ($partno == 1 and $stype eq 'MESSAGE' and $ptype eq 'MULTIPART') {
+ $pno = "TEXT";
+ $p->{_prefix} = "$prefix";
+ }
+ else {
+ $p->{_prefix} = "$prefix$partno";
+ }
$p->{_id} ||= "$prefix$pno";
push @parts, $p, $p->{bodystructure} ? $p->bodystructure : ();
Modified: trunk/libmail-imapclient-perl/t/basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/t/basic.t?rev=58673&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/t/basic.t (original)
+++ trunk/libmail-imapclient-perl/t/basic.t Mon May 31 04:53:17 2010
@@ -37,27 +37,30 @@
BEGIN { use_ok('Mail::IMAPClient') or exit; }
-my @new_args = (
- Server => $parms{server},
- Port => $parms{port},
- User => $parms{user},
- Password => $parms{passed},
- Authmechanism => $parms{authmech},
+my %new_args = (
+ Server => delete $parms{server},
+ Port => delete $parms{port},
+ User => delete $parms{user},
+ Password => delete $parms{passed},
+ Authmechanism => delete $parms{authmech},
Clear => 0,
Fast_IO => $fast,
Uid => $uidplus,
Debug => $debug,
);
+# allow other options to be placed in test.txt
+%new_args = ( %new_args, %parms );
+
my $imap = Mail::IMAPClient->new(
- @new_args,
+ %new_args,
Range => $range,
Debug_fh => ( $debug ? IO::File->new( 'imap1.debug', 'w' ) : undef )
);
ok( defined $imap, 'created client' );
$imap
- or die "Cannot log into $parms{server} as $parms{user}.\n"
+ or die "Cannot log into $new_args{Server} as $new_args{User}.\n"
. "Are server/user/password correct?\n";
isa_ok( $imap, 'Mail::IMAPClient' );
@@ -66,8 +69,8 @@
my $testmsg = <<__TEST_MSG;
Date: @{[$imap->Rfc822_date(time)]}
-To: <$parms{user}\@$parms{server}>
-From: Perl <$parms{user}\@$parms{server}>
+To: <$new_args{User}\@$new_args{Server}>
+From: Perl <$new_args{User}\@$new_args{Server}>
Subject: Testing from pid $$
This is a test message generated by $0 during a 'make test' as part of
@@ -197,7 +200,7 @@
}
else {
if ( $imap->LastError =~ /NO Invalid.*name/ ) {
- ok( 1, "$parms{server} doesn't support quotes in folder names" );
+ ok( 1, "$new_args{Server} doesn't support quotes in folder names" );
}
else { ok( 0, "failed creation with quotes" ) }
ok( 1, "skipping 1/2 tests" );
@@ -292,7 +295,7 @@
#
my $im2 = Mail::IMAPClient->new(
- @new_args,
+ %new_args,
Timeout => 30,
Debug_fh => ( $debug ? IO::File->new(">./imap2.debug") : undef ),
);
@@ -349,7 +352,7 @@
ok( $im2->close, "close" );
$im2->delete($migtarget);
-ok( $im2->logout, "logout" ) or diag("logout error: $@");
+ok_relaxed_logout($im2);
# Test IDLE
SKIP: {
@@ -381,9 +384,21 @@
$imap->_disconnect;
ok( $imap->reconnect, "reconnect" );
+ok_relaxed_logout($imap);
+
# Test STARTTLS - an optional feature so tests always succeed
{
- ok( $imap->logout, "logout" ) or diag("logout error: $@");
$imap->connect( Starttls => 1 );
ok( 1, "OPTIONAL connect(Starttls=>1)" . ( $@ ? ": (error) $@ " : "" ) );
}
+
+# LOGOUT
+# - on successful LOGOUT $code is OK (not BYE!) see RFC 3501 sect 7.1.5
+# however some servers return BYE instead so we let that pass here...
+sub ok_relaxed_logout {
+ my $imap = shift;
+ local ($@);
+ my $rc = $imap->logout;
+ my $err = $imap->LastError || "OK";
+ ok( ( $rc or $err =~ /^\* BYE/ ), "logout: $err" );
+}
Modified: trunk/libmail-imapclient-perl/t/bodystructure.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmail-imapclient-perl/t/bodystructure.t?rev=58673&op=diff
==============================================================================
--- trunk/libmail-imapclient-perl/t/bodystructure.t (original)
+++ trunk/libmail-imapclient-perl/t/bodystructure.t Mon May 31 04:53:17 2010
@@ -2,12 +2,12 @@
use strict;
use warnings;
-use Test::More tests => 18;
+use Test::More tests => 20;
BEGIN { use_ok('Mail::IMAPClient::BodyStructure') or exit; }
my $bs = <<'END_OF_BS';
-(BODYSTRUCTURE ("TEXT" "PLAIN" ("CHARSET" "us-ascii") NIL NIL "7BIT" 511 20 NIL NIL NIL))^M
+(BODYSTRUCTURE ("TEXT" "PLAIN" ("CHARSET" "us-ascii") NIL NIL "7BIT" 511 20 NIL NIL NIL))
END_OF_BS
my $bsobj = Mail::IMAPClient::BodyStructure->new($bs);
@@ -27,11 +27,11 @@
is(
join( "#", $bsobj->parts ),
- # Parsing in version 3.03, changed outcome from
+ # Parsing in version 3.03-3.23, changed (broke) outcome from
# this: "1#2#2.HEAD#2.1#2.2#2.2.HEAD#2.2.1#2.2.1.1#2.2.1.2"
# to: "1#2#2.HEAD#2.1#2.1.1#2.1.2#2.1.2.HEAD#2.1.2.1#2.1.2.1.1#2.1.2.1.1.1#2.1.2.1.1.2"
- # Patches to BodyStructure.pm in 3.24 changed it to this:
- "1#2#2.HEAD#2.TEXT#2.1#2.2#2.2.HEAD#2.2.TEXT#2.2.1#2.2.1#2.2.2",
+ # Patches to BodyStructure.pm in 3.25 changed it to this:
+ "1#2#2.HEAD#2.TEXT#2.1#2.2#2.2.HEAD#2.2.TEXT#2.2.1#2.2.1.1#2.2.1.2",
'parts'
);
@@ -76,7 +76,7 @@
my $bs7 = q{(BODYSTRUCTURE (("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 20 1 NIL NIL NIL NIL)("message" "rfc822" NIL NIL NIL "7bit" 1810 ("Fri,07 May 2010 01:55:07 -0400" "wrap inner a" (("Phil Pearl" NIL "phil" "perkpartners.com")) (("Phil Pearl" NIL "phil" "perkpartners.com")) (("Phil Pearl" NIL "phil" "perkpartners.com")) ((NIL NIL "phil" "perkpartners.com")) NIL NIL NIL "<25015.1273211707 at local>") (("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 27 3 NIL NIL NIL NIL)("message" "rfc822" NIL NIL NIL "7bit" 783 ("Fri, 07 May 2010 01:54:14 -0400" "inner msg #1" (("Phil Pearl" NIL "phil" "perkpartners.com")) (("Phil Pearl" NIL "phil" "perkpartners.com")) (("Phil Pearl" NIL "phil" "perkpartners.com")) ((NIL NIL "phil" "perkpartners.com")) NIL NIL NIL "<24986.1273211654 at local>") ("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 25 3 NIL NIL NIL NIL) 23 NIL ("inline" ("filename" "52")) NIL NIL) "mixed" ("boundary" "=-=-=") NIL NIL NIL) 58 NIL ("inline" ("filename" "53")) NIL NIL) "mixed" ("boundary""==-=-=") NIL NIL NIL))};
$bsobj = Mail::IMAPClient::BodyStructure->new($bs7);
- at exp = qw(1 2 2.HEAD 2.TEXT 2.1 2.2 2.2.HEAD 2.2.TEXT);
+ at exp = qw(1 2 2.HEAD 2.TEXT 2.1 2.2 2.2.HEAD 2.2.1);
ok( defined $bsobj, 'parsed seventh' );
is_deeply( [ $bsobj->parts ], \@exp, 'bs7 parts' )
or diag( join(" ", $bsobj->parts ) );
@@ -85,7 +85,16 @@
my $bs8 = q{(BODYSTRUCTURE (("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 31 2 NIL NIL NIL NIL)("message" "rfc822" NIL NIL "My forwarded message" "7bit" 2833 ("Fri, 07 May 2010 01:55:40 -0400" "outer msg" (("Phil Pearl" NIL "phil" "perkpartners.com")) (("Phil Pearl" NIL "phil" "perkpartners.com")) (("Phil Pearl" NIL "phil" "perkpartners.com")) ((NIL NIL "phil" "perkpartners.com")) NIL NIL NIL "<25030.1273211740 at local>") (("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 20 1 NIL NIL NIL NIL)("message" "rfc822" NIL NIL NIL "7bit" 1810 ("Fri, 07 May 2010 01:55:07 -0400" "wrap inner a" (("Phil Pearl" NIL "phil" "perkpartners.com")) (("Phil Pearl" NIL "phil" "perkpartners.com")) (("Phil Pearl" NIL "phil" "perkpartners.com")) ((NIL NIL "phil" "perkpartners.com")) NIL NIL NIL "<25015.1273211707 at local>") (("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 27 3 NIL NIL NIL NIL)("message" "rfc822" NIL NIL NIL "7bit" 783 ("Fri, 07 May 2010 01:54:14 -0400" "inner msg #1" (("Phil Pearl" NIL "phil" "perkpartners.com")) (("Phil Pearl" NIL "phil" "perkpartners.com")) (("Phil Pearl" NIL "phil" "perkpartners.com")) ((NIL NIL "phil" "perkpartners.com")) NIL NIL NIL "<24986.1273211654 at local>") ("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 25 3 NIL NIL NIL NIL) 23 NIL ("inline" ("filename" "52")) NIL NIL) "mixed" ("boundary" "=-=-=") NIL NIL NIL) 58 NIL ("inline" ("filename" "53")) NIL NIL) "mixed" ("boundary" "==-=-=") NIL NIL NIL) 91 NIL ("inline" ("filename" "52")) NIL NIL)("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 30 2 NIL NIL NIL NIL)("application" "octet-stream" NIL NIL "My attachment" "7bit" 76 NIL ("attachment" ("filename" ".signature.cell")) NIL NIL)("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 31 2 NIL NIL NIL NIL) "mixed" ("boundary" "===-=-=") NIL NIL NIL))};
$bsobj = Mail::IMAPClient::BodyStructure->new($bs8);
- at exp = qw(1 2 2.HEAD 2.TEXT 2.1 2.2 2.2.HEAD 2.2.TEXT 2.2.1 2.2.2 2.2.2.HEAD 2.2.2.TEXT 3 4 5);
+ at exp = qw(1 2 2.HEAD 2.TEXT 2.1 2.2 2.2.HEAD 2.2.TEXT 2.2.1 2.2.2 2.2.2.HEAD 2.2.2.1 3 4 5);
ok( defined $bsobj, 'parsed eighth' );
is_deeply( [ $bsobj->parts ], \@exp, 'bs8 parts' )
or diag( join(" ", $bsobj->parts ) );
+
+# Ryan Finnie MIME torture test
+my $bs9 = q{(BODYSTRUCTURE (("text" "plain" ("CHARSET" "US-ASCII") NIL NIL "8bit" 617 16 NIL NIL NIL NIL)("message" "rfc822" NIL NIL "I'll be whatever I wanna do. --Fry" "7bit" 582 ("23 Oct 2003 22:25:56 -0700" "plain jane message" (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) ((NIL NIL "bob" "domain.dom")) NIL NIL NIL "<1066973156.4264.42.camel at localhost>") ("text" "plain" ("CHARSET" "US-ASCII") NIL NIL "8bit" 311 9 NIL NIL NIL NIL) 18 NIL ("inline" NIL) NIL NIL)("message" "rfc822" NIL NIL "Would you kindly shut your noise-hole? --Bender" "7bit" 1460 ("23 Oct 2003 23:15:11 -0700" "messages inside messages inside..." (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) ((NIL NIL "bob" "domain.dom")) NIL NIL NIL "<1066976111.4263.74.camel at localhost>") (("text" "plain" ("CHARSET" "US-ASCII") NIL NIL "8bit" 193 3 NIL NIL NIL NIL)("message" "rfc822" NIL NIL "At the risk of sounding negative, no. --Leela" "7bit" 697 ("23 Oct 2003 23:09:05 -0700" "the original message" (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) ((NIL NIL "bob" "domain.dom")) NIL NIL NIL "<1066975745.4263.70.camel at localhost>") (("text" "plain" ("CHARSET" "US-ASCII") NIL NIL "8bit" 78 3 NIL NIL NIL NIL)("application" "x-gzip" ("NAME" "foo.gz") NIL NIL "base64" 58 NIL ("attachment" ("filename" "foo.gz")) NIL NIL) "mixed" ("boundary" "=-XFYecI7w+0shpolXq8bb") NIL NIL NIL) 25 NIL ("inline" NIL) NIL NIL) "mixed" ("boundary" "=-9Brg7LoMERBrIDtMRose") NIL NIL NIL) 49 NIL ("inline" NIL) NIL NIL)("message" "rfc822" NIL NIL "Dirt doesn't need luck! --Professor" "7bit" 817 ("23 Oct 2003 22:40:49 -0700" "this message JUST contains an attachment" (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) ((NIL NIL "bob" "domain.dom")) NIL NIL NIL "<1066974048.4264.62.camel at localhost>") ("application" "x-gzip" ("NAME" "blah.gz") NIL "Attachment has identical content to above foo.gz" "base64" 396 NIL ("attachment" ("filename" "blah.gz")) NIL NIL) 17 NIL ("inline" NIL) NIL NIL)("message" "rfc822" NIL NIL "Hold still, I don't have good depth perception! --Leela" "7bit" 1045 ("23 Oct 2003 23:09:16 -0700" "Attachment filename vs. name" (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) ((NIL NIL "bob" "domain.dom")) NIL NIL NIL "<1066975756.4263.70.camel at localhost>") (("text" "plain" ("CHARSET" "US-ASCII") NIL NIL "8bit" 377 6 NIL NIL NIL NIL)("application" "x-gzip" ("NAME" "blah2.gz") NIL "filename is blah1.gz, name is blah2.gz" "base64" 58 NIL ("attachment" ("filename" "blah1.gz")) NIL NIL) "mixed" ("boundary" "=-1066975756jd02") NIL NIL NIL) 29 NIL ("inline" NIL) NIL NIL)("message" "rfc822" NIL NIL "Hello little man. I WILL DESTROY YOU! --Moro" "7bit" 1149 ("23 Oct 2003 23:09:21 -0700" "No filename? No problem!" (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) ((NIL NIL "bob" "domain.dom")) NIL NIL NIL "<1066975761.4263.70.camel at localhost>") (("text" "plain" ("CHARSET" "US-ASCII") NIL NIL "8bit" 517 10 NIL NIL NIL NIL)("application" "x-gzip" NIL NIL "I'm getting sick of witty things to say" "base64" 58 NIL ("attachment" NIL) NIL NIL) "mixed" ("boundary" "=-1066975756jd03") NIL NIL NIL) 33 NIL ("inline" NIL) NIL NIL)("message" "rfc822" NIL NIL "Friends! Help! A guinea pig tricked me! --Zoidberg" "7bit" 896 ("23 Oct 2003 22:40:45 -0700" "html and text, both inline" (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) ((NIL NIL "bob" "domain.dom")) NIL NIL NIL "<1066974044.4264.62.camel at localhost>") (("text" "html" ("CHARSET" "utf-8") NIL NIL "8bit" 327 11 NIL NIL NIL NIL)("text" "plain" ("CHARSET" "US-ASCII") NIL NIL "8bit" 61 2 NIL NIL NIL NIL) "mixed" ("boundary" "=-ZCKMfHzvHMyK1iBu4kff") NIL NIL NIL) 33 NIL ("inline" NIL) NIL NIL)("message" "rfc822" NIL NIL "Smeesh! --Amy" "7bit" 642 ("23 Oct 2003 22:41:29 -0700" "text and text, both inline" (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) ((NIL NIL "bob" "domain.dom")) NIL NIL NIL "<1066974089.4265.64.camel at localhost>") (("text" "plain" ("CHARSET" "US-ASCII") NIL NIL "8bit" 62 2 NIL NIL NIL NIL)("text" "plain" ("CHARSET" "US-ASCII") NIL NIL "8bit" 68 2 NIL NIL NIL NIL) "mixed" ("boundary" "=-pNc4wtlOIxs8RcX7H/AK") NIL NIL NIL) 24 NIL ("inline" NIL) NIL NIL)("message" "rfc822" NIL NIL "That's not a cigar. Uh... and it's not mine. --Hermes" "7bit" 1515 ("23 Oct 2003 22:39:17 -0700" "HTML and... HTML?" (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) ((NIL NIL "bob" "domain.dom")) NIL NIL NIL "<1066973957.4263.59.camel at localhost>") (("text" "html" ("CHARSET" "utf-8") NIL NIL "8bit" 824 22 NIL NIL NIL NIL)("text" "html" ("NAME" "htmlfile.html" "CHARSET" "UTF-8") NIL NIL "8bit" 118 6 NIL ("attachment" ("filename" "htmlfile.html")) NIL NIL) "mixed" ("boundary" "=-zxh/IezwzZITiphpcbJZ") NIL NIL NIL) 49 NIL ("inline" NIL) NIL NIL)("message" "rfc822" NIL NIL "The spirit is willing, but the flesh is spongy, and bruised. --Zapp" "7bit" 6683 ("23 Oct 2003 22:23:16 -0700" "smiley!" (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) ((NIL NIL "bob" "domain.dom")) NIL NIL NIL "<1066972996.4264.39.camel at localhost>") ((((("text" "plain" ("charset" "us-ascii") NIL NIL "quoted-printable" 1606 42 NIL NIL NIL NIL)("text" "html" ("charset" "utf-8") NIL NIL "quoted-printable" 2173 54 NIL NIL NIL NIL) "alternative" ("boundary" "=-dHujWM/Xizz57x/JOmDF") NIL NIL NIL)("image" "png" ("name" "smiley-3.png") "<1066971953.4232.15.camel at localhost>" NIL "base64" 1122 NIL ("attachment" ("filename" "smiley-3.png")) NIL NIL) "related" ("type" "multipart/alternative" "boundary" "=-GpwozF9CQ7NdF+fd+vMG") NIL NIL NIL)("image" "gif" ("name" "dot.gif") NIL NIL "base64" 96 NIL ("attachment" ("filename" "dot.gif")) NIL NIL) "mixed" ("boundary" "=-CgV5jm9HAY9VbUlAuneA") NIL NIL NIL)("application" "pgp-signature" ("name" "signature.asc") NIL "This is a digitally signed message part" "7bit" 196 NIL NIL NIL NIL) "signed" ("micalg" "pgp-sha1" "protocol" "application/pgp-signature" "boundary" "=-vH3FQO9a8icUn1ROCoAi") NIL NIL NIL) 176 NIL ("inline" NIL) NIL NIL)("message" "rfc822" NIL NIL "Kittens give Morbo gas. --Morbo" "7bit" 3113 ("23 Oct 2003 22:32:37 -0700" "the PROPER way to do alternative/related" (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) (("Ryan Finnie" NIL "rfinnie" "domain.dom")) ((NIL NIL "bob" "domain.dom")) NIL NIL NIL "<1066973557.4265.51.camel at localhost>") (("text" "plain" ("CHARSET" "US-ASCII") NIL NIL "8bit" 863 22 NIL NIL NIL NIL)(("text" "html" ("CHARSET" "utf-8") NIL NIL "8bit" 1283 22 NIL NIL NIL NIL)("image" "gif" NIL "<1066973340.4232.46.camel at localhost>" NIL "base64" 116 NIL NIL NIL NIL) "related" ("boundary" "=-bFkxH1S3HVGcxi+o/5jG") NIL NIL NIL) "alternative" ("type" "multipart/alternative" "boundary" "=-tyGlQ9JvB5uvPWzozI+y") NIL NIL NIL) 79 NIL ("inline" NIL) NIL NIL) "mixed" ("boundary" "=-qYxqvD9rbH0PNeExagh1") NIL NIL NIL))};
+
+$bsobj = Mail::IMAPClient::BodyStructure->new($bs9);
+ at exp = qw(1 2 2.HEAD 2.1 3 3.HEAD 3.TEXT 3.1 3.2 3.2.HEAD 3.2.TEXT 3.2.1 3.2.2 4 4.HEAD 4.1 5 5.HEAD 5.TEXT 5.1 5.2 6 6.HEAD 6.TEXT 6.1 6.2 7 7.HEAD 7.TEXT 7.1 7.2 8 8.HEAD 8.TEXT 8.1 8.2 9 9.HEAD 9.TEXT 9.1 9.2 10 10.HEAD 10.TEXT 10.1 10.1.1 10.1.1.1 10.1.1.1.1 10.1.1.1.2 10.1.1.2 10.1.2 10.2 11 11.HEAD 11.TEXT 11.1 11.2 11.2.1 11.2.2);
+ok( defined $bsobj, 'parsed ninth' );
+is_deeply( [ $bsobj->parts ], \@exp, 'bs9 parts' )
+ or diag( join(" ", $bsobj->parts ) );
More information about the Pkg-perl-cvs-commits
mailing list