Jun 23, 2008 14:17
Several days ago, I toyed with the idea of making a significant change to the IMAP server at cepheid.org. The server software currently in use is not known for its reconfigurability, and due to a combination of legacy, flexibility, and probably a host of other factors, the mail configuration uses your home directory as the root for your IMAP folders. This is less than ideal. When looking for IMAP folders, it will find such things as dotfiles, your public_html folder (and files and subfolders therein), and frankly, anything you've got lying around the server.
This can be good or bad. For proper mail clients which let you override the root folder (and will only look inside the subfolder of your choice), this allows you the flexibility of defining where you want to put things. You can put them in ~/mail, ~/Mail, ~/imap, ~/.imap, ~/thisfoldermakesnosenseformailbutIuseitbecauseIcan, etc. Unfortunately, for mail clients which don't support such niceties, this can lead to problems. In some cases, it just shows a bunch of crap. In worse cases, it can hang your mail client as it struggles to keep up with the vast amount of data that it thought it asked for when it started looking for your IMAP folders. Mobile phones (including Windows Mobile-based phones and the iPhone) both fall into this latter category.
At first, the obvious way of making the IMAP server more phone-friendly was to enforce a strict mail folder setting onto everyone. There are obvious problems with doing this--namely, people who have already correctly configured their mail clients would suddenly be without mail. And it would be hard to notify these people of the issue[1].
Amazingly, if you dig into the documentation of the server software, it turns out that it is fairly configurable if you're willing to work at it. And here's the upshot of this entire post: if you want to set a directory for the server software to default to for IMAP folders, create a .imaprc file in your home directory with the following two lines:
I accept the risk
set mail-subdirectory Mail
You may substitute the word Mail for any valid subdirectory of your home directory. And yes, the first line "I accept the risk" is required.
I may, at some point, make this a system-wide default. If I do, I can populate everyone's home directories with similar files setting them back to the old default. I haven't yet decided.
[1] Not strictly true, as this doesn't affect your inbox, just your other folders.