It is annoying that some protocols and systems are more complex than you might expect them to be.
Jabber is a protocol that is notionally simple: XML Messages pass back and forth between server(s) and client(s). But if you look at the contents of XML which is passed around you'll soon discover that even logging in is a complex operation and that Jabber is not implemented in a pleasant fashion.
By contrast many other protocols are lovely. I'm sure I'm not alone in using and debugging many common protocols with nothing more than telnet. SMTP, HTTP, POP3, etc, are all pretty easy to drive interactively.
I think 90% of programmers at some point in their lives implement a HTTP server. But I draw the line at that kind of thing these days, client-side applications are useful and simple enough with the right libraries. (e.g. my sift client-side IMAP scripter has replaced procmail on a couple of machines. Watching to see if I get a reply from somebody specific and sending me an SMS on a match..)
But recently I've been flirting with the development of an IMAP server.
Dovecot appears to be the canonincal IMAP/POP3 server these days and it is pretty close to meeting my needs, but it isn't close enough unless I jump through and change the way my mailboxes are organised. (ie. The maildir mailboxes are arranged in such a fashion that dovecot cannot easily handle them, unless I mess about with symlink farms and make them all read-only.)
I guess in conclusion it would be nice if there were a basic IMAP server framework which you could just subclass "login" and "mailbox" sections and then instantiate.
I wrote a quick inetd-driven hack which supports only the bare essentials ("NOOP", "CAPABILITY", "LOGIN", "FETCH", "SELECT" and "LIST") That allows me to connect via IMAP in both mutt and thunderbird, view folders and download messages.
Still I'm strongly suspecting that there are better uses of my time, even if I could use it in several ways..
ObFilm: La Femme Nikita
Tags: imap, pop3, random 9 comments
What makes IMAP great is that you can just download certain headers and/or individual MIME-chunks of messages (contrast with POP). Unfortunately, this means that a minimally useful IMAP client needs to be able to parse all manner of shitty abominations to RFC822 and RFC204x.
Other thorny issues: how do you generate persistent UUIDs for messages? How do you handle IDLE and locking of mailboxes (both SMTP and IMAP side). How many of the various login methods do you want to support? What kinds of user<->mailbox mapping do you want to support? Do you want to handle TLS yourself, or just punt to stunnel? Is Sieve important?
There is room out there for a good extensible IMAP server, but IMO Dovecot is the closest thing there is.