libyal / libpff

Library and tools to access the Personal Folder File (PFF) and the Offline Folder File (OFF) format
GNU Lesser General Public License v3.0
289 stars 74 forks source link

transport header missing for multiple messages? #101

Closed Deeborg closed 3 years ago

Deeborg commented 3 years ago

Hi Team, transport_header returns none for most of the messages in pst file. I checked those messages manually and compared those to where transport headers are being read and I do not see any difference between them. Could you please help? I have attached screenshot of one of the mails which was giving None when extracting transport headers for your reference.

image

Deeborg commented 3 years ago

All I am looking for from header is sender address, recipient address, cc, bcc. Is there any alternative to get them? I could find only sender_name function in message class. Had no luck with others.

joachimmetz commented 3 years ago

@Deeborg pff is a MAPI value database, it really depends from version to version, file to file, what MAPI values are stored and which not. You'll have to do the research which values are stored in your file and which not e.g. pffexport has multiple modes here that can help you.

Also since you mention None, pypff has not yet been completed also see https://github.com/libyal/libpff/issues/2

Deeborg commented 3 years ago

Looks like the problem is with encoding. Those messages encoded with UTF-8 are being read. Others with western European are returning None. I have also noticed few messages where headers are not displayed when I go to message properties and encoding information is not available for these messages.

joachimmetz commented 3 years ago

Can you provide a sample file or debug output https://github.com/libyal/libpff/wiki/Troubleshooting#verbose-and-debug-output. PFF and MAPI after all are proprietary, partially documented, formats

Deeborg commented 3 years ago

Please download sample pst from below link https://drive.google.com/file/d/1otTielU_uHntcVENUMtk5BTkFWTyIhsK/view?usp=sharing

Is there any other way to extract recipient, cc and bcc details? message class has only sender_name.

joachimmetz commented 3 years ago

Is there any other way to extract recipient, cc and bcc details?

you could get the raw MAPI values

joachimmetz commented 3 years ago

Please download sample pst from below link

thx I'll have a look as soon as time permits

Deeborg commented 3 years ago

Is there any other way to extract recipient, cc and bcc details?

you could get the raw MAPI values

Thanks! That would totally solve my problem. I would appreciate if you could help me get MAPI values with pypff. I went through the source and am unable to find it.

joachimmetz commented 3 years ago

Try record_entry.get_data() https://github.com/libyal/libpff/blob/main/pypff/pypff_record_entry.c#L54

Deeborg commented 3 years ago

record_entry works on what object? Or rather how do I create record_entry object?

Deeborg commented 3 years ago

Got it. I was trying get_entry directly on message object.
message.get_record_set(0).get_entry(0).get_data() --> This works Please let me know if i'm wrong here. Now, i'm thinking I should look at https://github.com/libyal/libfmapi/blob/main/documentation/MAPI%20definitions.pdf for the argument to enter in get_entry().

Deeborg commented 3 years ago

Got everything to work as required. Thanks for this amazing library and the support!!

MaheshE99ME25 commented 11 months ago

Hi Deeborg, Could you please guide how you extracted From, to, subject data from the get_data method.

luckman212 commented 11 months ago

@Deeborg Would you be so kind as to post your working code? I am struggling to extract some email addresses (sender/recipient) from a PST...

MaheshE99ME25 commented 7 months ago

@luckman212

https://gist.github.com/MaheshE99ME25/2317c5c7302f843ebddbf42f5eea1358