Today I stared building an IMAP4rev1 client module in Erlang. It appears to be a good candidate for a finite state machine and I’m going to be building it in a non-blocking fashion, similar to a tutorial on http://www.trapexit.org .

I’m planning this to be a stand alone module that I can easily give out as open source and I’m also thinking it will be a component of the erlmail server that I am planning, someday.

In developing the SMTP server for SFE, I found it much easier to write after I had already developed the SMTP client. So I also hope that this inspires me to start working on the IMAP server not long after I finish up the client.

The IMAP client is going to be the center piece of a new web-based email program that I am writing. This will be the 4th or 5th time I have written a web-based email client and the second time that it involves IMAP, but the first time I am writing the IMAP client myself.

The last one I used was written in Java and I wrote a wrapper to use it in Cold Fusion. While it worked, it was clumsy and slow. In taking from that experience I have a few thoughts on how to cache data in the Erlang version that was not available to me in Cold Fusion.

In any case, I had better get back to reading RFCs if I’m going to get any work done on this.