Skip to content

Instantly share code, notes, and snippets.

View fernandodenitto's full-sized avatar

Fernando De Nitto fernandodenitto

View GitHub Profile
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)
@fernandodenitto
fernandodenitto / mBoxSendersExctractor.py
Created March 16, 2020 20:47
mBoxSendersExtractor
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)