koodaamo / tnefparse

a TNEF decoding library written in python, without external dependencies
GNU Lesser General Public License v3.0
49 stars 37 forks source link

nullbytes in data #24

Closed TZanke closed 5 years ago

TZanke commented 5 years ago

I try to get some tnef data information, but atm i have to remove nullbytes by myself. Is there a other way to get the same information without nullbytes, or is this is a bug?

  for tnef_attachment in tnef.attachments:
            for mapi_attr in tnef_attachment.mapi_attrs:
                if mapi_attr.name == tnefparse.TNEFMAPI_Attribute.MAPI_ATTACH_MIME_TAG:
                    mimetype = mapi_attr.data[0].rstrip(b'\x00')
petri commented 5 years ago

Is this on PyPI release or current master? Also, can you provide an example file to test this on?

TZanke commented 5 years ago

correction: has traling null also in Ubuntu tested with master.

tnef_with_umlaut.eml.zip