How to get mailbox statistics
Thread poster: Samuel Murray

Samuel Murray  Identity Verified
Netherlands
Local time: 15:25
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 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


Direct link Reply with quote
 

veratek
Brazil
Local time: 11:25
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.


Direct link Reply with quote
 

Samuel Murray  Identity Verified
Netherlands
Local time: 15:25
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.


Direct link Reply with quote
 

veratek
Brazil
Local time: 11:25
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 a quick look here:

http://kb.mozillazine.org/Importing_and_exporting_your_mail



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


Direct link Reply with quote
 

Samuel Murray  Identity Verified
Netherlands
Local time: 15:25
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.


Direct link Reply with quote
 

Jaroslaw Michalak  Identity Verified
Poland
Local time: 15:25
Member (2004)
English to Polish
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 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]


Direct link Reply with quote
 

Samuel Murray  Identity Verified
Netherlands
Local time: 15:25
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.


Direct link Reply with quote
 

Jaroslaw Michalak  Identity Verified
Poland
Local time: 15:25
Member (2004)
English to Polish
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).


Direct link Reply with quote
 

Samuel Murray  Identity Verified
Netherlands
Local time: 15:25
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.


Direct link Reply with quote
 

Jaroslaw Michalak  Identity Verified
Poland
Local time: 15:25
Member (2004)
English to Polish
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.

Direct link Reply with quote
 


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

Advanced search






Déjà Vu X3
Try it, Love it

Find out why Déjà Vu is today the most flexible, customizable and user-friendly tool on the market. See the brand new features in action: *Completely redesigned user interface *Live Preview *Inline spell checking *Inline

More info »
SDL Trados Studio 2017 Freelance
The leading translation software used by over 250,000 translators.

SDL Trados Studio 2017 helps translators increase translation productivity whilst ensuring quality. Combining translation memory, terminology management and machine translation in one simple and easy-to-use environment.

More info »



Forums
  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search