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
286 stars 74 forks source link

Question: Reading signed emails #95

Closed Nick-P-Orr closed 3 years ago

Nick-P-Orr commented 3 years ago

I'm developing an app to read emails from a PST and export them as individual HTML files. I'm using PyPFF with the following code:

pst_file = pypff.file()
pst_file.open(selectedPST)

root = pst_file.get_root_folder()

for folder in root.sub_folders:
    for sub in folder.sub_folders:
        for message in sub.sub_messages:
            print(message.get_html_body())

but when I come across a signed email, it returns 'none'. Is there any way to read them?

PyWIN32 is able to read these signed emails, but because of another issue (it strips a tag containing info I need), I can't totally rely on it.

joachimmetz commented 3 years ago

In which MAPI property is the signed email body stored?

Nick-P-Orr commented 3 years ago

From my understanding it's a smime.p7m attachment but as for a MAPI property I'm unsure.

http://www.cryptigo.eu/FAQ/

joachimmetz commented 3 years ago

You'll likely need to read the attachment then not the HTML body MAPI property. Have a look at https://github.com/libyal/libfmapi/blob/main/documentation/MAPI%20definitions.pdf

Also note that pypff is work-in-progress https://github.com/libyal/libpff/issues/2

Nick-P-Orr commented 3 years ago

Thank you for the pointers 😁

joachimmetz commented 3 years ago

Ack, I'll consider the question answered then.