If you’re interested in running a fairly full featured mail server on Windows, take a look at hMailServer — it’s completely free and through version 4 Open Source.

I have a patch to V4.4.2-B279 and V4.4.2-B283 that allows you to set the directory separator for IMAP folders (by default it will use “.” — and for many people that’s not a good choice).

To get it working:

  • Download the source.
  • Download the patch.
  • Un-archive the patch
  • Apply the patch (easy to do with SVN)
  • Setup a build environment (Microsoft VS2005, Microsoft VB6, Inno Setup v5, CollabNet SVN [optional]).
  • Run the build tool (you may need to make some changes to it’s configuration).
  • Install the resulting package.
  • Edit the INI file and change the FolderSeparator to “/” or “\” (I would not advise using other characters)
  • Restart the service.

It only took me a couple hours to modify and test the code; other than installing the environment to build it (and I recommend you do that on a virtual machine since these are older tools) it should take you substantially less time.

Some notes:

  • The changes to the build configuration are not necessary; you will need to make the appropriate changes for your build environment so I would say don’t apply them.
  • The changes to the HIS_DBWrappers is because you do not need to (and in many cases it will fail) register the built DLL on your build machine; it will be packaged in the install file and registered on installation (you would only need it registered if you wanted to debug, and I recommend building, installing, and then attaching to the running process so you need not worry about configuration issues if you want to debug).
  • This is Open Source software, and it’s not MY software — I don’t make any claims about it or warrant it in any way.  It’s your responsibility to test it.  While I’m certainly interested in anything you find, I’m in no way responsible.

I have a couple more modifications I’m considering (both of which will require much more work):

  • Changing the way folders and sub-folders are stored so that the folders appear in the file system in directories that match the folder names (and removing the limits on depth and number).
  • Potentially adding a ‘search’ feature that’s integrated with WDS to quickly find messages.  Since IMAP will only search within a folder, I’m thinking about adding a special folder called “Search” and any folder created in it will actually be the search term and the results displayed will be dynamic based on WDS output. 

In case you’re wondering, I don’t really care about hMailServer as an end-point mail server; I care about to manage my IMAP message store.  I have nearly 40GB of mail, nearly 50,000 folders, and WAY too many messages store on a server with 16 spindles in a RAID5 configuration.  So my “interest” doesn’t align closely with most users.

This is only the patch file; you must download the source from here.

These are patches produced from the specific versions listed, but they can (most likely) be applied to any v4.4.2 build fairly recent).

Originally posted 2008-11-09 08:00:38.