anyMail, Mozilla, Programming, Thunderbird, Toby


Unlike most of my posts, this one isn’t about some new software I’ve written; it’s about some old software I’ve written.

In 2002, like any other college student out on his own for the first time, I decided to write my own e-mail client.

What – you haven’t written your own e-mail client? You will. As a complement to both Letts’ Law (“All programs evolve until they can send email”) and Zawinski’s Law (“Every program attempts to expand until it can read mail.”), I propose Finke’s Law: “All programmers will write their own mail client (and later regret it).”

I named my webmail client Toby and used it as my primary client for three years; once it was stable enough for other people to use, I started publishing updates on SourceForge (back before GitHub became the new SourceForge). Toby was my first legitimate open-source project.

Toby Web Mail, in its heyday, Outlook Express was a big influence. Also, the Pokemon cards were my brother’s.

In 2004, I needed a few more credits to finish my degree in Computer Science, and I opted to do an independent study under Joseph Konstan. (Professor Konstan was one of the only profs at the University of Minnesota at that time who had some involvement in Web software; the other one that I knew of was John Riedl, who was already the head of the fledgling Software Project class that I was a part of, which is a topic for another post.) For my project, I decided to refine my mail client, using IBM’s Remail prototype as a roadmap.

Over that semester, I rewrote Toby and branded it as anyMail. I don’t remember why I called it anyMail, but it was probably because it could connect to any IMAP or POP3 mail account. Clever.

Some of the features I planned on integrating into anyMail were inspired (read: stolen) from the very-new (at that time) Gmail; specifically, labels (instead of folders), the concept of “archiving”, and an entirely AJAX-based system for loading messages (although at that time, the term “AJAX” hadn’t been coined yet). However, one feature that I beat Google to was my own version of Priority Inbox. From my project proposal:

I intend to implement: […] Automatic sorting of incoming mail into different categories, such as read, unread, un-replied to, messages from people the user has replied to in the past, messages likely to be spam, messages from people in the user’s address book, etc. I feel that one of the largest areas for improvement in current Web mail clients is that of automatic information sorting and presentation.

(Of course, I wasn’t the first to ever think of this concept. Microsoft has prior art dating to the late ’90s.)

A concept I implemented from IBM’s Remail was thread arcs. Thread arcs are a way to visually represent a conversation using circles and arcs:

The hollow circles are messages sent by the user; the solid circles are replies. Clicking on a circle loads the corresponding message. Neat, but not terribly useful.

As far as I know, I was the only person to have implemented thread arcs outside of the Remail prototype at that time. They’ve gotten around by now; there is even a Thunderbird add-on that generates them.

So, fast-forward to a couple of days ago, where I had blissfully forgotten about the hundreds of hours I spent writing code to parse multipart e-mail. I was searching through my e-mail for something unrelated, and I happened across a conversation between myself and Rob Malda; I was applying for a job at Slashdot, and I had sent him a link to anyMail as a part of my application. The URL was dead, so I did the reasonable thing: hunted down a copy of the source code, upload it to that server, and get it to work.

Here goes nothing.

And it did work! After ten minutes of creating the necessary database tables and an email address to use for testing (I didn’t want to inadvertently wipe the contents of an important account – I trust my code, but I don’t trust trust it), I logged in and had a working instance of anyMail before me:

I played around, sent and received a few e-mails to confirm functionality, and was mostly pleased with how well anyMail held up.

The only flaw I found was that attachments didn’t get sent. That might be a misconfiguration my Web host though.

This was amazing to me. The last time I used anyMail, it was in Firefox 1.0, and it still works in Firefox 11 and Chrome Umpteen, without the benefit of a JavaScript library like jQuery doing the heavy lifting of cross-browser compatibility. It was also written in an environment with PHP < 4.3, and ran mostly without issue under PHP 5.2.

The other thing that surprised me was how consistent my coding style has been over the last eight years. Even though I was shocked and appalled by the gaping security holes (XSS, CSRF, and SQL injection issues were all present) and disgusted by the number of synchronous XHR calls, I was pleased to recognize the code as mine. I don’t specifically remember writing it, but I can tell by the formatting, variable names, and structure that it was formed by my hand.

I spent a few minutes cleaning up the code — some basic protection against XSS and SQL injection — and uploaded it to GitHub. I don’t expect anyone to use it (and I hope nobody does, at least not without modification), but I’m keeping it around so I can look back on it and learn from my mistakes. But hey, if you need a class to generate thread arcs in PHP or an email client that works in Firefox 1.0, you know where to look.

Update: Toby is no longer supported. I recommend using RoundCube Webmail instead.

anyInventory, Blog, Toby

Here’s What You Should Think

I’ve imported all of the posts from my first blog (“Here’s What You Should Think”), which I started and ended in 2004. Most of them are related to Toby, a webmail client I wrote in college, and anyInventory, an open-source inventory system I was developing around the same time.

Update: I am no longer involved in the development of anyInventory.

Update: Toby is no longer supported. I recommend using RoundCube Webmail instead.

Here's What You Should Think, Toby

You’re Free, You’re Free!

I’ve released another Toby version, 0.4.1 this time. What changes have I made? Well, I’ll tell you what changes I’ve made: improved HTML message support, improved multipart message support, interface improvements (including section headers and collapsable sections) and a whole lotta extra love. Doesn’t that make you just want to download it?

Update: Toby is no longer supported. I recommend using RoundCube Webmail instead.

Here's What You Should Think, Toby

Toby 0.4 in the Works

Toby Web Mail 0.4 is in the works. Changes include language customization (currently only available for English and Spanish — if you want to help out by translating a language file, e-mail, better install and upgrade scripts, and a completely re-written message handling class. Attachment handling success is nearing 100%, and messages are now parsed into a standards-compliant format before they are written to the database, rather than every time they are displayed. Yay for optimization!

Update: Toby is no longer supported. I recommend using RoundCube Webmail instead.