This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
#Oper the file with the From Field from the Mailbox | |
file_in=open('mail_addresses_from_mbox.txt','r') | |
#Read the file and store it in a string | |
addresses_lines=file_in.read() | |
# Find all the email addresses inside and store it into a list | |
address_list=re.findall('\S+@\S+',addresses_lines) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mailbox | |
#WARNING:Check the right path for your .mbox file, in Mac OS Environment the .mbox is a directory so you can navigate it | |
# the .box files could be very heavy also! | |
mbox_path='INBOX.mbox/mbox' | |
file_to_store_fields_path='mail_addresses_from_mbox.txt' | |
mbox = mailbox.mbox(mbox_path) |