Analyse Your Email Usage with Mail Trends
Posted by Gina Trapani at 2:00 AM on April 15, 2008

Managing the daily onslaught of incoming email with filing systems, keyboard shortcuts, and batch processing will only get you so far. When a flurry of new email snows you in within an hour of every inbox sweep, it's time to dig in and get to the source of your email traffic. You've accumulated a sizable email archive over the years, and a new breed of analysis tool can extract meaningful statistics from that data to help you conquer email overload. Who sent you the most email messages last year? What hour of the day do you receive the most new messages? Which of all the mailing lists you're on are the most active? A new command line tool called Mail Trends works with Gmail over IMAP and can give you all that information and more.
" title="top -->">top -->

Comments (AU Comments · US Comments)
There are currently no AU comments for this post.
Kaobear
Posted 2:57 AM 15/4/08
Well, everything looks like it is working, except it is taking forever. I am assuming the parsing is dependent on your connection speed?
Kaobear
Gina Trapani
Posted 3:15 AM 15/4/08
It takes some time... depends on how much mail you have, how much memory you have, and how fast the machine is. Mine took about 10 minutes apiece at 75k messages or so.
Gina Trapani
thy
Posted 4:03 AM 15/4/08
@Gina Trapani: Wow...that you have a timespan for every 75 THOUSAND messages - that scares me. I can barely manage a few thousand, let alone double digits...
thy
Gina Trapani
Posted 4:16 AM 15/4/08
@thy: Heh, yeah, two years worth of mail, 76k messages, 54k threads--April 2006 to April 2008. None of it in my inbox, of course. :)
Gina Trapani
ww2db.com
Posted 4:43 AM 15/4/08
Hmmm this is pretty interesting! Knowing me, with this tool, I will probably reach analysis-paralysis, but it'll be fun nevertheless ^_^
ww2db.com
Prolific Programmer
Posted 5:57 AM 15/4/08
Doesn't work for my email if I use_ssl and there were a few other little problems as well.
Prolific Programmer
landsnark
Posted 6:35 AM 15/4/08
Had to install cheetah template system, but after that it worked on the first go. Analyzed 10k emails in a just a few minutes. Really cool little app.
landsnark
kd5ftn
Posted 7:17 AM 15/4/08
I tried it on my mac. After installing Cheetah, running Mail Trends tells me this:
[2008-04-14 16:15:38,300] Initializing
Traceback (most recent call last):
File "main.py", line 249, in
opts = GetOptsMap()
File "main.py", line 35, in GetOptsMap
assert "username" in opts_map
AssertionError
cool..
kd5ftn
flatlinebb
Posted 7:11 AM 15/4/08
It was buggy as heck. I ran it inside a VM of Ubuntu 7.04. after making sure i had the right version of python, it still wouldn't run without an error, until I specified all arguments in the command line. Then it actually processed over 9000 emails and spit out a web page. I don't, however, feel that I learned anything from the graphs. I get a lot of email, most are from my family and my wife - nothing new there.
flatlinebb
braam
Posted 8:17 AM 15/4/08
Nice! Doesn't this just beg for an implementation using Google App Engine?
braam
Gatewayy
Posted 7:33 PM 15/4/08
@kd5ftn:
I have the same problems as well. :(
Gatewayy
KSMarksPsych
Posted 9:32 PM 15/4/08
@Brett:
Me as well.
I've got Python 2.5 on Fedora 7.
Oh well, it would have been fun. And since I know zero python, I'll let it go.
KSMarksPsych
FlintZA
Posted 10:35 PM 15/4/08
@kd5ftn and Brett, I had the same problem. It's fixed by hardcoding your details (nice, huh? ;))
You need to edit the "main.py" file in the mail-trends folder as follows:
Go to line 32 and replace the following TWO lines:
for name, value in opts:
opts_map[name[2:]] = value
with the NINE lines:
# for name, value in opts:
# opts_map[name[2:]] = value
opts_map["server"] = "imap.gmail.com"
opts_map["username"] = "yourname@gmail.com"
opts_map["use_ssl"] = ""
opts_map["me"] = "yourname@gmail.com"
opts_map["skip_labels"] = ""
opts_map["password"] = "yourpassword"
opts_map["max_messages"] = "1000"
Now just replace 'yourname' and 'yourpassword' as appropriate.
NOTE: Python is really sensitive to tabs, so you may need to make sure that the tabs line up with the existing code. You don't need to recompile or anything, just run the command again :)
FlintZA
yellowmac
Posted 1:30 AM 16/4/08
This is _exactly_ what I've been hoping gmail would implement into their site for months! So I've been trying to get it to install on my Mac (10.5), but I think I'm running into a simple error. Cheetah seems to be installed, but mail-trends is complaining that it can't seem to find the module for cheetah. Any suggestions?
yellowmac
wmasson
Posted 10:14 AM 15/4/08
+ Watch video
I love email analysis tools. I use Xobni at both work and home. It plugs into outlook. Its still in beta though and there are still a few kinks. It works great for organizing attachments, conversations, and it even pulls phone numbers out of emails. I have quite a few invites left. If you want to try it out you can reach me at
[recklesslyaccounting.blogspot.com]
btw: I have no affiliation with Xobni, I just think it rocks.
wmasson
Brett
Posted 4:08 PM 16/4/08
@FlintZA:
That fixed it, thank you very much for the Python assistance!
Brett
KSMarksPsych
Posted 10:48 PM 16/4/08
@FlintZA:
Thank you so much!
The white space got me the first time around, but the second time I got it right.
This is really cool!
KSMarksPsych
physician
Posted 3:31 AM 17/4/08
@physician: oops, meant to say "python 2.5.2" not "ruby 2.5.2". sorry.
physician
physician
Posted 3:30 AM 17/4/08
i run into the same assertion error that kd5ftn received. this is on a mac running leopard and ruby 2.5.2. when i use FlintZa's solution, i run into an indentation error. strangely enough, everything runs fine in a parallels VM under windows XP.
physician
Majwell
Posted 1:42 PM 17/4/08
This is pretty nifty, but this guy has put together one hell of a list of email visualizations.
[flowingdata.com]
Majwell
Wyco
Posted 8:46 AM 17/4/08
@FlintZA:
It still doesnt work for me :/
I tried several tab versions but it always gets back to unexpected indent.
Can anyone post a well-tabbed generic version of the file? (like having it with 'yourname' instead of course of real names and passes.
Thnx
Wyco
TBW
Posted 8:04 PM 17/4/08
@yellowmac:
I'm having this issue too. Although on Windows XP. Has anybody got this working on Windows?
TBW
powaking
Posted 11:42 PM 17/4/08
XOBNI FTW! Rocks the house. Try to get an invite if at all possible. I sill have 4.
powaking
Tricky
Posted 11:17 AM 19/4/08
Dear Powaking: Could you please send me an invite to Xobni? I'd greatly appreciate it. mathprog777 [at] gmail [dot] com. Thanks!
Tricky