The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Minimal IMAP server: how difficult to implement?

I'm considering writing a minimal IMAP server in Perl for my own specialized needs, but I'm unsure if I can pull it off in the time I can dedicate to it. I only need most basic operations, but the IMAP spec looks enormous.

Has anyone written IMAP servers or clients? How big, do you think, a most basic implementation of the protocol (list/fetch/store messages/folders) would be in Perl?
Thursday, July 14, 2005
Considering the dearth of good IMAP servers, and the near absence of fully-compatible IMAP clients (with support for offline work), I doubt developing an IMAP server can be done with a few lines of Perl...
Thursday, July 14, 2005
IMAP is much more complex that POP3. I was just reading about this on the dovecot listserv.
Thursday, July 14, 2005
I overheard a really heavy email user (due to his fame) say the other day that he can't find a good mail client that does IMAP right. Someone mentioned to him that maybe he doesn't need IMAP. He concurs: although in the past he has many machines, now he uses one powerful laptop. So maybe you should really look at how you use email. If POP is all you need, that maybe what you are after.
Li-fan Chen Send private email
Friday, July 15, 2005
That way lies madness.  According to the author of the Courier IMAP server, the specs are actually internally inconsistent.
Art Send private email
Friday, July 15, 2005
We have an Imap product, basically a .NET component that allows you to connect to an Imap server, download and process the messages etc. We support most Imap features in an intuitive way, see for more information.

The specs (primarily RFC 2060) are very detailed and explains what Imap servers and client "must" or "should" do.

Based on our experience, I must say that building an Imap server or client is not a trivial task. For an efficient and standards compliant implementation, you will need powerful lexers, parsers and a state machine.
Jeff Send private email
Tuesday, July 19, 2005
I bet a bunch of the gruntwork has been done for you -- check out the Perl Email Project:
Chris Winters Send private email
Monday, July 25, 2005
I advise you take a look at the specs and decide if the implementation effort is worth your time:

Have you already identified the functionality you need in your "minimal" implementation? You say it's for your internal needs.... why does it have to be IMAP?

emil kirschner
Wednesday, July 27, 2005
I want a mail store that is accessible from any decent mail reader and is very quick to search (for full-text or headers), even when it gets huge. So I've decided that hooking up a minimal server with an SQL DB backend would be a good option.
Wednesday, July 27, 2005
I'm not sure a SQL backend is optimal for full text searches - I would personaly use a full text search engine, like Lucene for java. I don't know if anything like that exists for perl (or is callable from perl).

Anyways, good luck.
Emil Kirschner
Wednesday, July 27, 2005
I embarked on such a project for the company I work for - IMAP server written in perl using postgres as a mail backing store.  I found out the hard way that the IMAP protocol is terrible - full of mistakes, hidden dangers, and just plain bad ideas.

(Turns out the inventor of the protocol is also the author of PINE and WU-IMAP - IMO two of the slowest, most bug-ridden email apps that I would never force any of my users to put up with.)

Making liberal use of caching and indexing still didn't get my SEARCH speed very high.  For that you need a full text index engine.

After 2 years of my company using it with a few niggles, I finally binned it since I didn't have enough time to support it and fix all the bugs - there's always a bunch of different ways to do the same thing in IMAP, and every client uses IMAP differently. 

We are now using Cyrus with full-text indexing enabled and it is blazing fast, I'm happy with it and so are the users.

So yeah, unless you are ready for a fair amount of hard work, don't bother.  On the flip side, I know alot about the IMAP protocol now so perhaps one day that will help me - hopefully a new protocol will come along to replace it though.

ps. Check out the "Dovecot" project
Andrew Snow Send private email
Thursday, August 04, 2005

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz