Franz Schwartau
2015-07-27 22:35:52 UTC
Dear list,
I'd like to use MIME::Tools for parsing a base64 encoded attachement of
an e-mail.
Please have a look at the attached tar.
If using the test script parse.pl with a base64 encoded test
attachement, ME_Parts isn't filled properly:
./parse.pl mail2-b64.eml
[...]
'ME_Parts' => [
bless( {
'ME_Bodyhandle' => bless( {
'MB_Path' => '/tmp/parser/msg-1438036387-58191-0/msg-58191-2.txt'
},
'MIME::Body::File' ),
'mail_inet_head' => bless( {
'mail_hdr_list' => [],
'mail_hdr_hash' => {},
'mail_hdr_foldlen' => 79,
'mail_hdr_modify' => 0,
'mail_hdr_lengths' => {},
'mail_hdr_mail_from' => 'KEEP'
},
'MIME::Head' ),
'ME_Parts' => []
}, 'MIME::Entity' )
],
[...]
It works with a 7bit attachement, though:
./parse.pl mail2-7bit.eml
[...]
'ME_Parts' => [
bless( {
'ME_Bodyhandle' => bless( {
'MB_Path' => '/tmp/parser/msg-1438036447-58356-0/msg-58356-2.txt'
},
'MIME::Body::File' ),
'ME_Parts' => [],
'mail_inet_head' => bless( {
'mail_hdr_foldlen' => 79,
'mail_hdr_hash' => {
'Subject' => [
\'Subject: This is just a test
'
],
'Date' => [
\'Date: Mon, 27 Jul 2015 23:56:46 +0200
'
],
'From' => [
\'From: ***@test.com
'
],
'To' => [
\'To: ***@test.com
'
]
},
'mail_hdr_mail_from' => 'KEEP',
'mail_hdr_lengths' => {},
'mail_hdr_list' => [
${$VAR1->{'ME_Parts'}[0]{'mail_inet_head'}{'mail_hdr_hash'}{'From'}[0]},
${$VAR1->{'ME_Parts'}[0]{'mail_inet_head'}{'mail_hdr_hash'}{'To'}[0]},
${$VAR1->{'ME_Parts'}[0]{'mail_inet_head'}{'mail_hdr_hash'}{'Date'}[0]},
${$VAR1->{'ME_Parts'}[0]{'mail_inet_head'}{'mail_hdr_hash'}{'Subject'}[0]}
],
'mail_hdr_modify' => 0
},
'MIME::Head' )
}, 'MIME::Entity' )
],
[...]
Why doesn't it work with a base64 encoded attachement?
Best regards
Franz
I'd like to use MIME::Tools for parsing a base64 encoded attachement of
an e-mail.
Please have a look at the attached tar.
If using the test script parse.pl with a base64 encoded test
attachement, ME_Parts isn't filled properly:
./parse.pl mail2-b64.eml
[...]
'ME_Parts' => [
bless( {
'ME_Bodyhandle' => bless( {
'MB_Path' => '/tmp/parser/msg-1438036387-58191-0/msg-58191-2.txt'
},
'MIME::Body::File' ),
'mail_inet_head' => bless( {
'mail_hdr_list' => [],
'mail_hdr_hash' => {},
'mail_hdr_foldlen' => 79,
'mail_hdr_modify' => 0,
'mail_hdr_lengths' => {},
'mail_hdr_mail_from' => 'KEEP'
},
'MIME::Head' ),
'ME_Parts' => []
}, 'MIME::Entity' )
],
[...]
It works with a 7bit attachement, though:
./parse.pl mail2-7bit.eml
[...]
'ME_Parts' => [
bless( {
'ME_Bodyhandle' => bless( {
'MB_Path' => '/tmp/parser/msg-1438036447-58356-0/msg-58356-2.txt'
},
'MIME::Body::File' ),
'ME_Parts' => [],
'mail_inet_head' => bless( {
'mail_hdr_foldlen' => 79,
'mail_hdr_hash' => {
'Subject' => [
\'Subject: This is just a test
'
],
'Date' => [
\'Date: Mon, 27 Jul 2015 23:56:46 +0200
'
],
'From' => [
\'From: ***@test.com
'
],
'To' => [
\'To: ***@test.com
'
]
},
'mail_hdr_mail_from' => 'KEEP',
'mail_hdr_lengths' => {},
'mail_hdr_list' => [
${$VAR1->{'ME_Parts'}[0]{'mail_inet_head'}{'mail_hdr_hash'}{'From'}[0]},
${$VAR1->{'ME_Parts'}[0]{'mail_inet_head'}{'mail_hdr_hash'}{'To'}[0]},
${$VAR1->{'ME_Parts'}[0]{'mail_inet_head'}{'mail_hdr_hash'}{'Date'}[0]},
${$VAR1->{'ME_Parts'}[0]{'mail_inet_head'}{'mail_hdr_hash'}{'Subject'}[0]}
],
'mail_hdr_modify' => 0
},
'MIME::Head' )
}, 'MIME::Entity' )
],
[...]
Why doesn't it work with a base64 encoded attachement?
Best regards
Franz