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

How to determine recurrence for Calendar items? #115

Closed philipsd6 closed 1 year ago

philipsd6 commented 1 year ago

I've managed to use pypff to load my *.ost file, and find my Calendar sub folder with this function:

In [242]: def find_sub_folder(root_folder, sub_folder_name):
     ...:     for folder in root_folder.sub_folders:
     ...:         if folder.name == sub_folder_name:
     ...:             return folder
     ...:         sub_folder = find_sub_folder(folder, sub_folder_name)
     ...:         if sub_folder is not None:
     ...:             return sub_folder
     ...:     return None
In [243]: cal = find_sub_folder(pff_obj.root_folder, "Calendar")

Then I can find the message I see in my calendar for a recurring meeting:

In [244]: for msg in cal.sub_messages:
     ...:     if msg.subject == 'My Recurring Meeting':
     ...:         break
In [245]: msg.conversation_topic == msg.subject == 'My Recurring Meeting'
Out[245]: True

But I can only find the start/end times for the first instance of the meeting, even though I have an instance occurring today!

In [252]: for rs in msg.record_sets:
     ...:     for e in rs.entries:
     ...:         if e.entry_type in [0x0060, 0x0061]:
     ...:             print(f"0x{e.entry_type:04x} {e.data_as_datetime}")
0x0060 2021-02-17 19:00:00
0x0061 2021-02-17 19:30:00

I've examined the MS-OXOCAL references as best I can, but none of the entry types I've tried that reference any recurrence are available in the record set:

In [259]: for rs in msg.record_sets:
     ...:     for e in rs.entries:
     ...:         if e.entry_type in [0x8216, 0x8231, 0x8232]:
     ...:             print(f"0x{e.entry_type:04x} {e.data}")

How can I get the full recurrence structure for a given Calendar message?

joachimmetz commented 1 year ago

Have a look at https://github.com/libyal/libfmapi/blob/main/documentation/MAPI%20definitions.pdf or use pffexport export all option to see what entry values are set.