College Emails

(Frivolous blog content, posted as part of a daily posting streak I have openly committed to; standard disclaimers apply)

Out of boredom and curiosity, I graphed how many emails colleges sent me, excluding the colleges I actually applied to. I am being extremely polite and just calling them emails. I’ve wanted to make this for a long time, but it wasn’t until I saw this post about an email experiment on that I understood which tools I could use to quantify my emails. (And then I actually made it and procrastinated posting it here for two months. If you look at my GitHub page or activity you might have seen it already, though. Oops.)

I don’t think the results were expected. Other than saying that, I leave the interpretation up to the reader because I’m on a tight blogging schedule. Cool? Cool.

Step-by-step instructions:

Step 1. Get offlineimap. If you’re on a Mac like me and you have homebrew (highly recommended), it’s available as brew install offlineimap. Otherwise you’re on your own.

Step 2. Create a suitable .offlineimaprc. If you are a Gmail user like me, know that Gmail is so popular that offlineimap has a custom type for it:

accounts = Gmail

[Account Gmail]
localrepository = Local
remoterepository = Remote

[Repository Local]
type = Maildir
localfolders = ~/email

[Repository Remote]
type = Gmail
remoteuser =
sslcacertfile = /usr/local/etc/openssl/osx_cert.pem
folderfilter = lambda x: x == 'foobar'

The names “Gmail, Local, Remote” in the first three parts can be chosen as you like. But the type = Gmail in the description of the remote repository must be exact, with capitalization.

Put a directory path you like under localfolders for the local repository. Change your remoteuser to be your full Gmail account, of course.

Then you need a sslcacertfile, a certificate file or something to secure your connection. I followed this StackOverflow answer blindly without really understanding what was happening.

If you just want emails under certain tags or folders, write a Python lambda under folderfilter that tests the tag string.

You may also need to enable less secure apps on your Gmail account to let it allow offlineimap. You can change it back later once offlineimap is done syncing. To sync, just put offlineimap.

Step 3. Get mu. Also available on Homebrew. Run mu index --maildir ~/email

Step 4. Get the data out of mu and process it into a usable form. In my case, I mimicked the Medium post and composed a command-line one-liner to extract the domains from which the emails were sent and turn them into usable comma-separated data that can be thrown into things such as this random d3.js bar chart generator I found online: mu find maildir:/collegespam --fields f | perl -ne '/<.*?@(.*?)>/; print "$1\n";' | sort | uniq -c | awk '{ print $2 "," $1 }'

Step 5. Label. I manually labeled the domain names with their colleges where it wasn’t obvious and sprinkled lots of other annotations onto the list because I was too lazy to automate this. I also added the ordinal scale coloring by top-level domain by myself.

Step 6. Avoid procrastination. Whoops. I procrastinated posting this, so I had to manually adjust the numbers while preserving the labels several times; I regret this. So don’t procrastinate, kids!


2 thoughts on “College Emails

  1. 這一天我們趕到台北要包粽子, 中午是吃Subway在車上解決的. 到了台北.女生留在家裡包粽子, 你和爸爸去孫老師那裡談到長春演講的事(又給你攬了一項業務), 這個演講留下來好好講可以讓許多來問我們問題的人一個很好的回答, 包括如何開始寫程式或為什麼要學寫程式等等.加油啦.
    晚餐後, 大家一樣聊天看電視打麻將, 但我知道你提早洗好澡, 小睡幾分鐘, 為十點即將登場的第三回合code jam做準備. 上一回合你的排名是四百多名, 這一回合應該只是陪賽而已. 但你還是喜歡動腦筋, 接受挑戰, 我也鼓勵你和全世界的高手交手, 為你加油. 但媽媽太累了, 不敵周公召喚, 先行睡去. 在阿媽家, 對滿枕頭棉被雜物的小和式房, 妹妹將電視關小聲的在一旁看電視, 引你分心, 媽媽在一旁呼呼大睡, 讓你可憐的孤軍奮戰, 我估計能進前一兩百名就很不簡單了. 沒想到, 睡夢中聽到你小聲的說道” 怎麼辦, 真的比進前25名了….” 比進前25名? 我不是沒想過, 但覺得還要再過幾年吧, 沒想到, 竟然就發生在這個夏天. 媽媽為你實現夢想而高興, 也為我們這個夏天相處的時間又少了幾天, 而開始失眠.

  2. Pingback: C-c-c-Combo Breaker! | BetaWorldProblems

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s