Previous 1 2 Next 17 Replies Latest reply: Nov 27, 2012 12:14 PM by swissbaldo
koenraadfromleuven Level 1 (5 points)

I have an iMac and a MBP that are synced as portable home directories. Since I upgraded to Lion, when I switch machines (after syncing, of course), Mail always indicates that the index is broken and needs to be repaired. A process that takes 15 minutes at least.


I'm a bit at a loss because the portable home sync runs without errors...


Thanks for helping out.

iMac, Mac OS X (10.7)
  • Ernie Stamper Level 8 (37,545 points)

    Are both Macs running Lion?  I associate Portable Home Directories with a OSX Server -- is one involved here?  If so, what version of OSX is it running?



  • koenraadfromleuven Level 1 (5 points)

    Hi Ernie


    Both Macs are running Lion. The OS X server that handles the portable home directories is 10.6.8.



  • Ernie Stamper Level 8 (37,545 points)



    Sorry to not be able to test with a server, but I must note that the index file structure has changed -- in Mail 5.0, there are three files related to the Envelope Index, while in earlier versions of Mail only one.  I suspect the server is not able to maintain the three files that Mail 5.0 uses, and to allow their transfer.


    The three files are likely aged versions, but I have not confirmed.  The three file structure now applies to the MessageUidsAlreadyDownloaded file needed for POP accounts.  Do you have POP?



  • koenraadfromleuven Level 1 (5 points)



    I only use IMAP (MobileMe & my own server) plus one Exchange account.


    I just checked on the server and it turns out that in the ~/Library/Mail/V2 folder, it only has 3 folders, ie "Mailboxes", "Maildata" and "RSS". The iMac also lists an additional folder for each of the mail accounts. These folders contains the individual mailboxes of the mail accounts.


    The server does not seem to be able to sync these folders (or anything else dropped into the ~/Library/Mail/V2 folder) with the local copy. The permissions on these folders do not seem to be different from each other, or from those on the local home directory.


    So I guess you were right. Although I don't understand why these folders don't sync...

  • Ernie Stamper Level 8 (37,545 points)

    Having only those type of accounts, syncing should not even be needed.  IMAP and Exchange accounts should always be in sync, without PHD.


    Are there things outside of Mail that you are syncing?  The Address Book, I suppose?



  • koenraadfromleuven Level 1 (5 points)

    You're absolutely right. Syncing should not be needed. Address Book and iCal sync "over the air" with the server as soon as changes happen. And even when I was syncing Mail correctly (back in the 10.6.x days), all new messages were still being downloaded when I switched to the other machine. I never understood that since the Mail Downloads and Mail folders should get synced like everything else...


    Unfortunately, there is little leeway in tinkering with the Portable Home Sync. All one can do is exclude entire folders at the ~/ level. So I could indeed exclude ~/Library, but that would mean that all my app settings would no longer get synced between computers (including things like the 1Password database, the DevonThink Inbox,... which I really need).


    No easy solution here it seems, but thanks for helping out!



  • Ernie Stamper Level 8 (37,545 points)

    Will have the ponder aspects of Mail Downloads, but with IMAP (and exchange) accounts, the mailboxes reside on the server for each.  Any copy in the Mail folder is meant to only be temporary.  I am not suprised they are downloaded to each machine as the sync of a temporary file seems either reduncant, or not relevant.



  • ikonoklast Level 1 (0 points)

    Hi Ernie (Koenraad here again)


    To the best of my knowledge, the IMAP storage files are not just temporary. I guess one could call them semi-permanent, since they are indeed being refreshed off the server when a user connects. However, these files allow offline storage of mail messages, and these files are not being rebuilt every time one logs in. In my case, that would result in gigabytes of mail being transferred, which was never the case.


    Of course, now, I am stuck with downloading said gigabytes of mail, and I have lost my capability of reading mail offline, as I understand it (I will have to check that still but from what's transpiring, it seems obvious).

  • Ernie Stamper Level 8 (37,545 points)

    To read Offline requires that the messages and/or their attachments all be downloaded -- you are certainly correct.  When you reconnect, the files in the mailbox folder, with such information as deletions, Read status, replies and forwards will get applied to the server.


    But without the server sync in the mix, that should not require a redownloading with each reconnect of anything except changes and new messages.



  • Omniver Level 1 (10 points)

    Had the same issue (see


    The location of the Index (which does not need to be synced and is excluded by default in Server) changed in Lion mail.  You need to update the exclusions with the new location.  Sadly, Apple forgot to do this with Lion Server as well, they still reflect the old Snow Leopard locations which was my problem.


    In Worgroup Manager in mobility settings for the clients, under "Preference Sync" change (if you're running all Lion clients) or add the two Mail related items in the "Skip items..." section to the following:


    Partial Path: ~/Library/Mail/V2/MailData/AvailableFeeds

    Partial Path: ~/Library/Mail/V2/MailData/Envelope Index


    (note the Partial Path)

  • paquilina Level 1 (0 points)

    I had the same problem with Mail syncing and was able to exclude the files as noted. now opens on each computer without re-indexing and the headers are listed but the emails themselves cannot be located by the program.  If you look in the mailbox folders the messages are contained in a folder with a numeric, randomly generated code.  When mail rebuilds the index these folders are generated and are different on each machine.  In SL the messages were contained in a folder entitled Messages not in a folder with a randomly generated number.  Syncing will never work unless both are able to find the messages.  Is there a file that contains the locations of the messages and a pointer to these "code folders"?  I don't know why Apple changed the mailbox structure.  Both need to know these locations and they have to be the same for syncing to work.

  • koenraadfromleuven Level 1 (5 points)

    I guess the point is that the mail data are not being synced, rather than the opposite. I have checked the exclusions in Workgroup Manager (including the changes suggested above) and they do exclude most of the mail folders from being synced. Maybe all of it needs to be excluded, who knows?!


    That being said, I have not yet been able to solve my problem between my MBP and my iMac. After syncs, Mail still indicates that the envelope index is damaged, then on the next Mail start, it hangs.


    I will do a thorough "cleaning" of both Macs next Friday - deleting all Mail folders on both, syncing, checking home folder on server, restarting one Mac, starting Mail, exiting/syncing, starting the other, and then we will see. Will keep you posted!



  • koenraadfromleuven Level 1 (5 points)

    Here's the solution (it's a bit drastic, but it works).


    In wokgroup manager, exclude from preference sync the folder ~/Library/Mail/V2 altogether.

    In order for this to work, the "Match" criteria should be set to "Starts with", otherwise (apparently) any downstream folders keep on getting synchronized.


    Since I have done this, I have experienced no more problems switching  between the 2 machines that share the same portable home directory.


    Drawbacks: if you change anything to your accounts, signatures, smart mailboxes, you will have to duplicate this effort on the other machine (or at least copy over the relevant plist files in the ~/Library/Mail/V2/MailData folder), since these data will now no longer be synced.


    Thanks to everyone who helped me out on this one!



  • paquilina Level 1 (0 points)

    I tried your solution but Workgroup Manager will not allow the "/" character in a "Starts with" match.  it will not allow ~/Library/Mail/V2.  It will not save this setting.


    How did you get a path to be accepted with a "Starts with" match criteria?

Previous 1 2 Next