A friend lost their email contacts because of a hotmail hack... So I downloaded all emails they had sent to me and then used grep to create a list of email addresses. Heres how I did it:
- Create a label (friendsname) in Google mail for all email received from friendsemail@hotmail.co.uk
- Install Thunderbird and connect to my Google mail account using IMAP.
- Thunderbird creates a folder for each label, so go to the folder for friendsname
- Highlight all of the emails and select file -> save as -> folder name - this will save each email as a file in a folder (friendsfolder)
- Open a linux terminal or windows command prompt.
- Change directory to the folder in step 4 above (eg in Ubuntu: cd Documents/friendsfolder)
- Then enter grep -Eiorh '([[:alnum:]_.]+@[[:alnum:]_]+?\.[[:alpha:].]{2,6})' "./" | sort | uniq > emails.txt
- This will copy all email addresses into a file called emails.txt
Excellent, clearly described solution. Thank you very much.
ReplyDelete