I’ve been working on the IMAP server in ErlMail-0.0.6 as my primary project since I release ErlMail-0.0.5 last week. I think I’m about a third through the server and for what I’ve been doing I think it’s going pretty fast.
The main server is based off of my SMTP server for the TCP communications and the basic file structure. Although in the past few days I’ve been implementing some new strategies that I will need to put back into the SMTP server as well. Most of that code is around the extensions to the IMAP (or SMTP) protocols. I created a modules called IMAPD_EXT that is run when the IMAP server does not recognize a command. This modules looks at the config file to see the list of known extensions and then verifies if they extension is loaded in the path on the current IMAP server. The extensions are listed in the config file as “Module1:Funcation1 Module2:function2 Function3″ When the module name is left off the default of imapd_ext is used for the module name. With this setup the IMAP server will be able to be extended without recompiling the ErlMail code. By adding an extension in the config file and making sure it is located in the search path that the Erlang run-time uses anyone will be able to extend the IMAP (or SMTP) server with minor effort. (Depending on the extension of course)
I’ve also been working a lot with the modular message store. This has already changed significantly since ErlMail-0.0.5, which was the first version to have the message store in it. I’m finding that the IMAP server needs to have a decent amount of it’s logic in the message store, since the way the files are being accessed in each message store is so different. Most notably the Mnesia message store and the Maildir++ message store are light years away from each other in the logic they use to return the same results from each function in the module.
In effect this means I am writing about 25% of the IMAP server in each message store and I’m planning on having two to four message stores in the next release. This was more effort then I was expecting, but the results are more then worth it.
I’ve gotten another report of a bug in the IMAP client. Actually it the same bug, but it’s manifesting itself slightly differently now. I’m thinking this particular bug my require a rewrite of the IMAP grammar files for both LEEX and YECC. I may have to put this off till the next version of ErlMail, as this will be quite time consuming.
I’m hoping to get the next version of ErlMail out in the first half of November now. Hopefully I’ll get plenty of time to spend on it and it will be out sooner then that.






