IMAP-Client

 view release on metacpan or  search on metacpan

t/04parsefetch.t  view on Meta::CPAN

is($r{1112}->{'BODY'}->{2}->{'SIZE'}, 35734);
is($r{1112}->{'BODY'}->{2}->{'CONTENTTYPE'},'APPLICATION/OCTET-STREAM');
is($r{1112}->{'BODY'}->{2}->{'PARAMETERS'}->{'NAME'}, 'filename withspace.txt');
is($r{1112}->{'BODY'}->{2}->{'ENCODING'}, 'BASE64');

##############################################################
# Test Set 4
# forwarded-as-attachment message with 2 original attachments
# Tests: multiple depth layers/MIXED parts/attachments
##############################################################
@message = ('* 2773 FETCH (FLAGS (\Recent \Seen) UID 84583 INTERNALDATE "20-Dec-2025 16:47:33 -0500" ENVELOPE ("Tue, 20 Dec 2025 16:47:25 -0500" "testing (fwd)" (("Sammuel IMAPs" NIL "IMAPss" "sam.com")) (("Johnny Emails" NIL "emailj" "doe.com")) (("...

%r = $imap->parse_fetch(@message);

ok(%r) or print $imap->error;

is($r{2773}->{'FLAGS'}->[0], '\Recent');
is($r{2773}->{'FLAGS'}->[1], '\Seen');
is($r{2773}->{'UID'}, 84583);
is($r{2773}->{'INTERNALDATE'}, "20-Dec-2025 16:47:33 -0500");
is($r{2773}->{'ENVELOPE'}->{'FROM'}, 'Sammuel IMAPs <IMAPss@sam.com>');
is($r{2773}->{'ENVELOPE'}->{'TO'}, '<janedo@others.com>');
is($r{2773}->{'ENVELOPE'}->{'CC'}, undef);
is($r{2773}->{'ENVELOPE'}->{'BCC'}, undef);
is($r{2773}->{'ENVELOPE'}->{'SENDER'}, 'Johnny Emails <emailj@doe.com>');
is($r{2773}->{'ENVELOPE'}->{'REPLYTO'}, 'Johnny Emails <emailj@doe.com>');
is($r{2773}->{'ENVELOPE'}->{'INREPLYTO'}, undef);
is($r{2773}->{'ENVELOPE'}->{'SUBJECT'}, 'testing (fwd)');
is($r{2773}->{'ENVELOPE'}->{'DATE'}, 'Tue, 20 Dec 2025 16:47:25 -0500');
is($r{2773}->{'ENVELOPE'}->{'MESSAGEID'}, 'C4E39A6421682D937C33DCA4@desktop.others.com');
is($r{2773}->{'BODYSTRUCTURE'}->{'CONTENTTYPE'}, 'MULTIPART/MIXED');
is($r{2773}->{'BODYSTRUCTURE'}->{'EXT_PARAMETERS'}->{'BOUNDARY'}, '==========8F8D58A2EAD61ADC46B3==========');
is($r{2773}->{'BODYSTRUCTURE'}->{1}->{'LINES'}, 21);
is($r{2773}->{'BODYSTRUCTURE'}->{1}->{'SIZE'}, 425);
is($r{2773}->{'BODYSTRUCTURE'}->{1}->{'CONTENTTYPE'},'TEXT/PLAIN');
is($r{2773}->{'BODYSTRUCTURE'}->{1}->{'PARAMETERS'}->{'CHARSET'}, 'us-ascii');
is($r{2773}->{'BODYSTRUCTURE'}->{1}->{'PARAMETERS'}->{'FORMAT'}, 'flowed');
is($r{2773}->{'BODYSTRUCTURE'}->{1}->{'ENCODING'}, '7BIT');
is($r{2773}->{'BODYSTRUCTURE'}->{1}->{'DISPOSITION'}->{'INLINE'}, '');
is($r{2773}->{'BODYSTRUCTURE'}->{2}->{'CONTENTTYPE'}, 'MULTIPART/MIXED');



( run in 0.216 second using v1.01-cache-2.11-cpan-299005ec8e3 )