Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Fix an IMAP path prefix problem with Mail Apps
I have just switched hosts for my domain, including my email. My new host supports IMAP, where my old one did not, so I wanted to make the most of this to transfer all my mail folders to the server. I set up the account on my work MacBook Pro, and everything was fine. I made a directory on the server, then filled in that directory as the 'IMAP Path Prefix' in Mail's preferences for the account, and I could successfully create mailboxes and move messages in.

When I set up the account on my MacBook at home, however, Mail was completely ignoring the IMAP Path Prefix I set, and insisted on listing the entire contents of my home directory, including all the invisible files (.bash_history and so on) and, even worse, the whole public_html tree where my Web site is stored. Looking at a trace of the IMAP communication between Mail and the server, it was clearly a problem on my local machine rather than an error on the server, because Mail was asking for mailbox listings without mentioning the path prefix.

Since everything was still working fine on my work Mac, I thought that there must be some subtle difference in the preferences between the two computers, so I used BBEdit to compare the com.apple.mail.plist files from both machines. In amongst the many arbitrary differences that will always show up when comparing preference files from different computers (such as minor differences in the window sizes or column widths), I noticed the following key:
    <key>IMAPServerPrefixesMirrorFilesystem</key>
    <true/>
This setting was present in my work preferences file, but absent altogether from my home machine's preferences. Hoping that this key might be the culprit, I added this entry to the preferences file, restarted Mail, and suddenly everything worked properly -- it showed only the mailboxes in the actual mail folder on the server, not all of the other bits and pieces that had been showing up before.

If you are having a similar problem, whereby Mail seems to be ignoring the IMAP Path Prefix no matter how many times you try setting it, running the following command in a Terminal will make the appropriate change to Mail's settings:
defaults write com.apple.mail IMAPServerPrefixesMirrorFilesystem -bool true
[robg adds: I haven't tested this one.]
    •    
  • Currently 3.20 / 5
  You rated: 3 / 5 (5 votes cast)
 
[27,660 views]  

Fix an IMAP path prefix problem with Mail | 4 comments | Create New Account
Click here to return to the 'Fix an IMAP path prefix problem with Mail' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Fix an IMAP path prefix problem with Mail
Authored by: klatt on Dec 11, '08 08:07:33AM

Thanks, I always wondered why on some systems Mail seemed to ignore the IMAP prefix!

Thanks!



[ Reply to This | # ]
Fix an IMAP path prefix problem with Mail
Authored by: jms1 on Dec 11, '08 03:00:25PM

It depends on the IMAP server software in use on the server. My server used to use a program called courier-imap, which presents all other folders as children of "INBOX", with each segment separated by "." (like how a unix system uses "/" to separate directories and filenames.) If I were to manually configure Mail.app to work with this system, the "namespace prefix" would be "INBOX.".

I've since switched to dovecot, which can be configured to use any number of different namespace layouts- one of which is the one used by courier-imap, which made the transition easy (i.e. transparent) to my users.

The IMAP protocol itself allows the server to tell the client what to use as a namespace prefix. Both courier-imap and dovecot do this; it sounds like the server you're using is not.



[ Reply to This | # ]
RobG test it if you have broadband
Authored by: Ilgaz on Dec 12, '08 04:34:00AM

134 MB... Do you know why it is 134 MB? Because Adobe guys didn't compress the disk image!

It was same deal on "Adobe Flash Uninstaller" until I reported them the "bug".



[ Reply to This | # ]
Fix an IMAP path prefix problem with Mail
Authored by: xsundeep on Dec 31, '08 06:14:55AM

So...

Another place to look for this is a hidden file on your server (yes, on your server) named .mailboxlist : It should be in the homedirectory. Sometimes, you will see issues with this file. Renaming it will recreate a new one.

(Email clients do a surprising number of things that are server dependent- for instance, deal with "standard" mail formats versus "mbx" formats. They also save your folder structure in .mailboxlist, after which you will see the folder structure even if you change the imap prefix).



[ Reply to This | # ]