C.J. Adams-Collier writes:
Okay... imapd built from source. I'm taking a look at the maildir code to get familiar with the datastore infrastructure. Can anyone give me some general pointers? I'll be linking against libmysqlclient and replacing filesystem manipulation calls with SQL.Who's responsible for this bit of the code? I can't sync with the sf cvs repository, since it's (as usual) not responding...
Don't waste your time. Courier-IMAP has been written explicitly to provide IMAP access to maildirs. That's the server's entire purpose for existing, and you're not going to be able to just replace a few functions, and magically make it work with MySQL, because that's not how things work.
If you think that IMAP is nothing more then "oh, give me the contents of such and such message", then you're mistaken. There's much more to IMAP than that.
• A hierarchical folder structure. IMAP clients are permitted to use regular expressions to search for all folders that match the given pattern. Many IMAP clients are poorly written and demand the entire IMAP hierarchy be given to them lickety-split.
• A MIME parser. If you don't know what MIME is, then stop what you're doing now, and learn about it. MIME clients may request the IMAP server to return not just the copy of the entire message, but bytes 1000-2000 of the 3rd MIME attachment. And that's after the MIME client asks the server to return a parsed representation of the hierarchy of the message's MIME sections, as well as select headers from each MIME section. Additionally, IMAP servers must assess the size of each MIME section, in bytes and in lines, down to the last byte, and IMAP clients will rightfully complain if the server does not return the correct information. Because IMAP clients often make consecutive demands for different portions of the same IMAP message, Courier-IMAP keeps the message file open, and cached the message MIME's structure, in order to be able to respond in a reasonable amount of time.
It will be faster for you to write a new IMAP server from scratch, then to hack Courier-IMAP to use MySQL for storage.
pgpclY8nxGnBO.pgp
Description: PGP signature
