How to get mailbox statistics
Thread poster: Samuel Murray
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 19:01
Member (2006)
English to Afrikaans
+ ...
Apr 1, 2011

G'day everyone

I need a text file that contains a list of all mails in a mailbox (an standard MBOX file). The list should show at least the date and time that the mails were sent (these are all sent mails). I don't particularly care about any other statistics, but I need to know on what dates and times the mails were sent. Does anyone know of a utility (preferably in Windows) that can do this?

My mails are in Gmail, but Gmail doesn't show both date and time in the li
... See more
G'day everyone

I need a text file that contains a list of all mails in a mailbox (an standard MBOX file). The list should show at least the date and time that the mails were sent (these are all sent mails). I don't particularly care about any other statistics, but I need to know on what dates and times the mails were sent. Does anyone know of a utility (preferably in Windows) that can do this?

My mails are in Gmail, but Gmail doesn't show both date and time in the list of mails (otherwise I would simply have copied the text in the browser). I download my Gmail via POP to SeaMonkey, so that's the mail program I have, but the mailboxes are ordinary MBOX files that can be imported to any other mail program.

If you don't know of a utility that can grab statistics from an MBOX file, perhaps you know of a mail program that can output such statistics? Then I'll install it and import the mail to it.

I tried to script it but it is not so simple to do.

Thanks
Samuel
Collapse


 
veratek
veratek
Brazil
Local time: 14:01
French to English
+ ...
how about excel? Apr 1, 2011

Can't you just copy/paste your mbox text file into Excel?

Once into Excel, you extract the fields you want into another sheet or report.


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 19:01
Member (2006)
English to Afrikaans
+ ...
TOPIC STARTER
Excel Apr 1, 2011

veratek wrote:
Can't you just copy/paste your mbox text file into Excel? ... Once into Excel, you extract the fields you want into another sheet or report.


I don't quite understand how Excel could open an MBOX file. MBOX is not tab delimited. If I paste it into Excel, then each line of the MBOX file will be in a row, but then I'd still have to figure out how search for the rows with each message's date/time in it. I'm afraid I don't understand the Excel advice.


 
veratek
veratek
Brazil
Local time: 14:01
French to English
+ ...
apparently it uses CR+LF Apr 1, 2011

I use gmail with Thunderbird. Wikipedia says Thunderbird uses MBOX. I opened a local email file on my computer into a text document and then copied it into Excel. It asked me at a certain point if I wanted to keep (? insert?) the CR+LFs. Yes. So it put each email header info into a different line, sequentially. Since all mails apparently start with "From - date", I think you might be able to do what you want with Excel.

I also took
... See more
I use gmail with Thunderbird. Wikipedia says Thunderbird uses MBOX. I opened a local email file on my computer into a text document and then copied it into Excel. It asked me at a certain point if I wanted to keep (? insert?) the CR+LFs. Yes. So it put each email header info into a different line, sequentially. Since all mails apparently start with "From - date", I think you might be able to do what you want with Excel.

I also took a quick look here:

http://kb.mozillazine.org/Importing_and_exporting_your_mail



[Edited at 2011-04-01 21:27 GMT]
Collapse


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 19:01
Member (2006)
English to Afrikaans
+ ...
TOPIC STARTER
One solution Apr 1, 2011

Samuel Murray wrote:
I need a text file that contains a list of all mails in a mailbox (an standard MBOX file).


Here's one solution:
http://www.fookes.com/mailbag/
Select all mails in the list and use Ctrl+C to copy it to the clipboard. This works with the trial version.


 
Jaroslaw Michalak
Jaroslaw Michalak  Identity Verified
Poland
Local time: 19:01
Member (2004)
English to Polish
SITE LOCALIZER
Scripting Apr 1, 2011

What problems have you encountered when scripting? As emails are typically very well structured, it should be relatively easily to extract the info you require...

Perl even has its own cl
... See more
What problems have you encountered when scripting? As emails are typically very well structured, it should be relatively easily to extract the info you require...

Perl even has its own class that deals with MBOX directly:

http://search.cpan.org/~dcoppit/Mail-Mbox-MessageParser-1.5000/lib/Mail/Mbox/MessageParser/Perl.pm

[Edited at 2011-04-01 23:39 GMT]
Collapse


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 19:01
Member (2006)
English to Afrikaans
+ ...
TOPIC STARTER
Scripting Apr 2, 2011

Jabberwock wrote:
What problems have you encountered when scripting? As emails are typically very well structured, it should be relatively easily to extract the info you require...


My scripting abilities are very, very limited. A friend of mine wrote a small Python script for me (also using an MBOX class) to extract the dates, but his script and my script both extract more dates than there are mails. One would think that a script should be able to do it, since (as you say) the MBOX structure is predictable.

This is why the Excel method is also likely to fail (though I haven't tried it, because I'm using Excel 2003, which has a row limit of 65000, and my MBOX file has about 750 000 lines (because of all the attachments, probably)). The Excel method would be the same as my scripting method (using AutoIt script), namely to look for lines that conform to a certain pattern and then extracting the dates from those lines.

The Mailbag Assistant program doesn't really give statistics but it allows the user to copy a selection to the clipboard, so if you just filter in/out the appropriate mails, you can copy their details to the clipboard and then crunch the numbers from there.


 
Jaroslaw Michalak
Jaroslaw Michalak  Identity Verified
Poland
Local time: 19:01
Member (2004)
English to Polish
SITE LOCALIZER
Perl script Apr 2, 2011

I might have a look at this, but I cannot promise anything (even less that I will do it soon).

If I understand correctly, you want to extract the recipient (as you are the sender), the subject, the date and the time of each message?

If I do it, it will be in Perl, so it would need an installation on your part (ActivePerl would do).


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 19:01
Member (2006)
English to Afrikaans
+ ...
TOPIC STARTER
@Jabberwock Apr 2, 2011

Jabberwock wrote:
If I understand correctly, you want to extract the recipient (as you are the sender), the subject, the date and the time of each message?


I had already created a temporary mailbox in which I have copied only the mails for which I'm the sender, so you wouldn't have had to script that (although your script would be much more useful to others if you can do that, obviously).

What I personally needed was just a list of the dates/times of each mail. I needed this for tax purposes (I have to show the specific hours in which I was doing something at my computer, and I can't send a mail (except for out-of-office-replies) unless I'm at the computer).

What another user might find useful is if your output contains also the subject line of each mail and possibly also the name of the sender. After that, it gets more complicated (and more useful), e.g. names in CC, names in TO, whether there is an attachment and what its names are, the size of the mail (may be difficult to script because it aint written anywhere in the mail), etc.

For me personally, I just needed a list of dates and times, and with Mailbag Assistant, I was able to do it.

Oh, and yes, I have ActivePerl installed.


 
Jaroslaw Michalak
Jaroslaw Michalak  Identity Verified
Poland
Local time: 19:01
Member (2004)
English to Polish
SITE LOCALIZER
Mail sample Apr 2, 2011

Samuel, could you post a sample mail from the mbox? It seems that different programs use slightly different format, especially for designation of the message boundaries.

 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

How to get mailbox statistics






Protemos translation business management system
Create your account in minutes, and start working! 3-month trial for agencies, and free for freelancers!

The system lets you keep client/vendor database, with contacts and rates, manage projects and assign jobs to vendors, issue invoices, track payments, store and manage project files, generate business reports on turnover profit per client/manager etc.

More info »
Trados Studio 2022 Freelance
The leading translation software used by over 270,000 translators.

Designed with your feedback in mind, Trados Studio 2022 delivers an unrivalled, powerful desktop and cloud solution, empowering you to work in the most efficient and cost-effective way.

More info »