'Python Outlook headers
I got a script to extract Gmailheaders. There is a lot of information to extract. When I try to extract data from outlook it feels like im getting a small part.
The script I currently got is:
import win32com.client
import re
outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
inbox = outlook.GetDefaultFolder(6)
messages = inbox.Items
message = messages.GetFirst()
rec_time = message.CreationTime
body_content = message.body
while message:
To = message.To
Recipients = message.Recipients
Sender = message.Sender
address = message.Sender.Address
cc = message.CC
Importance = message.Importance
LastModificationTime = message.LastModificationTime
It prints the following fields:
print message.subject
print message.CreationTime
print To
print Sender
print address
print cc
print Importance
print LastModificationTime
Is there just a limit amount of Outlook headers you can extract or? I've tryed to look on sources like:
https://msdn.microsoft.com/en-us/VBA/Outlook-VBA/articles/mailitem-object-outlook
I am missing important information like sender IP-adresses. Is there anyway of extracting more information without using a 3partytool?
Thanks!
Edit: Works:
outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
inbox = outlook.GetDefaultFolder(6)
messages = inbox.Items
for message in messages:
msg = message.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x007D001F")
Solution 1:[1]
To see all MIME headers, read the PR_TRANSPORT_MESSAGE_HEADERS
MAPI property (DASL name http://schemas.microsoft.com/mapi/proptag/0x007D001F
) using MailItem.PropertyAccessor.GetProperty
.
You can see that property (as well as all other MAPI and OOM properties) using OutlookSpy (I am its author) - click IMessage button.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |