[Mimedefang] Problem with MIME::Tools and base64 encoded message/rfc822 attachements

Franz Schwartau franz at electromail.org
Mon Jul 27 18:35:52 EDT 2015


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 at test.com
'

                              ],

                    'To' => [

                              \'To: test at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: parser.tar.gz
Type: application/gzip
Size: 1439 bytes
Desc: not available
URL: <https://lists.mimedefang.org/pipermail/mimedefang_lists.mimedefang.org/attachments/20150728/07921d53/attachment.gz>


More information about the MIMEDefang mailing list