34,073 views
Free tool – Extracting email addresses from Outlook mail folders
I recently received the request to extract all email addresses from an Outlook pst file, not from the contacts, but from all emails within the Outlook folder structure. I opened the Outlook file (3,5Gb) and found a huge folder structure containing thousands of emails. Furthermore, I needed to get all unique email addresses from the sender, recipient and the body of the emails. So I decided to write a little script to extract the information.
The script uses the Outlook 2007 Outlook COM object and .Net Framework. I haven’t tested if it would work with previous versions of Outlook as well, so let me know if you have tested this.
The tool requires the pst file to be part of the list of available inboxes in Outlook, so before launching the script, you need to open the Data File in Outlook. Another requirement is that Outlook doesn’t prompt for a username. I’m using a "null" logon in the script, so I’m assuming your already have access to the mailbox.
Upon launching the tool, the list of available mailboxes/folder structures is displayed.
Select the mailbox that needs to be processed and click "Go". The tool will now enumerate all folders in the selected mailbox :
Select the folder(s) that should be used as starting point for the extraction. You can only multiple folder starting points at a time at this point, but pay attention to not select a parent folder and subfolders. By default, the tool crawls through a folder and its subfolders, so if you select a parent folder and a subfolder of that parent folder, the subfolder will be processed twice. The end result will be the same, it will just take more time to complete.
Next, select the ‘Sender’ and/or ‘Recipient and/or ‘Body’ option, which corresponds to the fields where email addresses will be extracted from. Click ‘Go’ under step 2 to proceed with the extraction.
Let it run for a while. When the script has finished, it will automatically prompt you to save the text file with email addresses. The file will contain all address from all selected folders and its subfolders. If you want to separate addresses from different folders, you’ll have to run the script again and select another set of folders.
Save the file. If you open the file, you’ll see the list of unique email addresses, sorted alphabetically.
The tool is free, but if you want to use it for commercial purposes, then please contact me to get donation details.
You can download the installer from http://users.telenet.be/internet.activities/freetools/outlookemailaddressextractor
© 2007 – 2015, Peter Van Eeckhoutte (corelanc0d3r). All rights reserved.
Similar/Related posts:
Comments are closed.
Corelan Training
Check out our schedules page here and sign up for one of our classes now!
Donate
Your donation will help funding server hosting.
Corelan Team Merchandise
Corelan on Slack
You can chat with us and our friends on our Slack workspace: