- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Collapse
You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:
- You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
- You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
- If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
Logging in...
Previously on "Extract all sender's email addresses from emails"
Collapse
-
I used live mail on Windows at the time, emails were in Appdata\local. Don't know where Mac saves things by default but I daresay all email apps allow backup to folder of your choice. Some parts of emails are encoded but the headers are always plain text AFAIK.Last edited by xoggoth; 26 September 2021, 16:45.
-
Originally posted by xoggoth View Post
Excel VBA does it quite easily. Used to do it to check order emails until they started putting everything into PDF.
Code below is quick untested extract from a much more complicated thing so probably got a few errors, but close enough.
'Option Compare Text
Public r As Integer
Private Sub CommandButton1_Click()
Dim fold As String
'clear list
Range("A15:A500").Select
Selection.ClearContents
Range("A15").Select
'sheet row
r = 1
'For each folder in list
fol = 1
Do
fold = Range("C5").Cells(fol, 1).Value
If fold <> "" Then
getemails (fold)
fol = fol + 1
End If
Range("AF2").Value = fol
Loop While fold <> ""
End Sub
Sub getemails(mailpath As String)
Dim FSO As FileSystemObject
Dim fileList As Object, email As Object
Dim fname As String, fullpath As String
Dim temp As String As String
' Create an object form the filesystem object
Set FSO = CreateObject("Scripting.FileSystemObject")
'set output list
Set outlist = Range("A15")
' Traverse through the files
nmail = 0
For Each email In fileList
' Get the file name
fname = email.Name
If InStr(fname, ".eml") Then
'look for key fields in file - this is mostly ascii
fullpath = mailpath & "" & fname
Open fullpath For Input As #1
Do While (Not EOF(1))
Line Input #1, temp
temp2 = Trim(temp)
'get from line
If InStr(temp, "From: ") > 0) then
outlist.Cells(r, 1).Value = temp
r=r+1
End If
Loop
Close #1
Next
End Sub
Leave a comment:
-
a) Dumping the lot to excel and binning everything but the 'From' info
Code below is quick untested extract from a much more complicated thing so probably got a few errors, but close enough.
'Option Compare Text
Public r As Integer
Private Sub CommandButton1_Click()
Dim fold As String
'clear list
Range("A15:A500").Select
Selection.ClearContents
Range("A15").Select
'sheet row
r = 1
'For each folder in list
fol = 1
Do
fold = Range("C5").Cells(fol, 1).Value
If fold <> "" Then
getemails (fold)
fol = fol + 1
End If
Range("AF2").Value = fol
Loop While fold <> ""
End Sub
Sub getemails(mailpath As String)
Dim FSO As FileSystemObject
Dim fileList As Object, email As Object
Dim fname As String, fullpath As String
Dim temp As String As String
' Create an object form the filesystem object
Set FSO = CreateObject("Scripting.FileSystemObject")
'set output list
Set outlist = Range("A15")
' Traverse through the files
nmail = 0
For Each email In fileList
' Get the file name
fname = email.Name
If InStr(fname, ".eml") Then
'look for key fields in file - this is mostly ascii
fullpath = mailpath & "" & fname
Open fullpath For Input As #1
Do While (Not EOF(1))
Line Input #1, temp
temp = Trim(temp)
'get from line
If InStr(temp, "From: ") > 0) then
outlist.Cells(r, 1).Value = temp
Exit Do
End If
r=r+1
Loop
Close #1
Next
End SubLast edited by xoggoth; 26 September 2021, 11:36.
Leave a comment:
-
Sure.
See the code below. Save it as .py file. It is crude but does the job.
Change here:
PHP Code:pop_conn = poplib.POP3_SSL('mx.mail.com', '995')
pop_conn.user('[email protected]')
pop_conn.pass_('password')
It will put all email addresses in a text file with append option, so if it fails, delete the content of the txt file so far.
Emails will be extracted from the 'from' header so possibly very messy. You will need to process the list in excel (other) to get rid of duplication etc.
PHP Code:print >> open('emails-list.txt', 'a'), message['from']
Code:import poplib,time from email import parser pop_conn = poplib.POP3_SSL('mx.mail.com', '995') pop_conn.user('[email protected]') pop_conn.pass_('password') #Get messages from server: stt=time.ctime() print 'getting messages started at %s\n' %(stt) messages = [pop_conn.top(i,0) for i in range(1, len(pop_conn.list()[1]) + 1)] endt=time.ctime() print 'done getting messages at %s\n' %(endt) # Concat message pieces: messages = ["\n".join(mssg[1]) for mssg in messages] #Parse message intom an email object: messages = [parser.Parser().parsestr(mssg) for mssg in messages] for message in messages: print >> open('emails-list.txt', 'a'), message['from'] pop_conn.quit()
Last edited by gisp; 26 September 2021, 08:37.
Leave a comment:
-
Originally posted by gisp View PostIf you have POP3 access you can use python script to do this.
there's even IMAP python, but this is overkill.
Python script is less than 10 lines.
No need to do 25 steps process with GBs of installation of software.
I have the script somewhere, let me know if you want it.
Leave a comment:
-
If you have POP3 access you can use python script to do this.
there's even IMAP python, but this is overkill.
Python script is less than 10 lines.
No need to do 25 steps process with GBs of installation of software.
I have the script somewhere, let me know if you want it.
Leave a comment:
-
There seem to be tools called 'olm extractors' that will do what you want. Not being a mac user I can't say if they're scams, malware or what-not but it appears to be a common requirement to extract a variety of things from that file type.
Leave a comment:
-
Originally posted by ladymuck View Post
Leave a comment:
-
-
I think I need some way of either;
a) Dumping the lot to excel and binning everything but the 'From' info
b) Dumping in to some sort of formatted/structured file that I can parse
Edit: Sorry if I wasn't clear, I have a copy of all the emails locally in outlook (and airmail) - I just want to identify all the places I've signed up to over the past two decades using that address either as contact info or username.Last edited by Pondlife; 24 September 2021, 13:04.
Leave a comment:
-
Watching this one with interest. I'm in the same situation with my BT address. My fear is not only extracting the old ones but capturing anything that I haven't seen for awhile. Yearly reminders and the like. BT won't do a forwarding rule and I can't have the email address only if I don't use any other of their services so they only way I can make sure I've got everything is to keep the old one open for a year or two but that defeats the object of moving away from BT.
I don't think Virgin delete their mailboxes anyway.Last edited by northernladuk; 24 September 2021, 12:58.
Leave a comment:
-
I'd suggest extract the entire contents of the mailbox as PST file.
Then slurp it all into Gmail (IMAP should manage that).
Then gmail will do its thing and read all your emails and then when you try and email someone it will make a stab at the recipient.
Or.... I don't think Virgin delete their mailboxes anyway. It's far too complex for them with all the mergers over the years and that fact that you might subscribe to all sorts of different services they offer. They're just not joined up enough.
Leave a comment:
-
Extract all sender's email addresses from emails
I'm probably about to bin a provider (Virgin) which means I'll lose access to the email address I've used for the past twenty odd years. So I'm looking for a way to extract all the sender's email addresses from my inbox to ensure I can update with a new address (or create new logons etc). There will be 10,000 plus emails easily.
I have Airmail (Mac), Outlook for Mac, Thunderbird (Linux) or could create a gmail acct to access.
Any ideas on how to do so?
TIA
Pondy.Tags: None
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- Spot the hidden contractor Dec 20 10:43
- Accounting for Contractors Dec 19 15:30
- Chartered Accountants with MarchMutual Dec 19 15:05
- Chartered Accountants with March Mutual Dec 19 15:05
- Chartered Accountants Dec 19 15:05
- Unfairly barred from contracting? Petrofac just paid the price Dec 19 09:43
- An IR35 case law look back: contractor must-knows for 2025-26 Dec 18 09:30
- A contractor’s Autumn Budget financial review Dec 17 10:59
- Why limited company working could be back in vogue in 2025 Dec 16 09:45
- Expert Accounting for Contractors: Trusted by thousands Dec 12 14:47
Leave a comment: