Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Mail index breaks at login after portable home sync

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)

Posted on Aug 6, 2011 7:45 AM

Reply
17 replies

Aug 6, 2011 8:17 AM in response to koenraadfromleuven

Koenraad,


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?


Ernie

Aug 6, 2011 8:46 AM in response to Ernie Stamper

Ernie,


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...

Aug 6, 2011 9:01 AM in response to Ernie Stamper

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!


Koenraad

Aug 6, 2011 9:28 AM in response to Ernie Stamper

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).

Aug 6, 2011 9:39 AM in response to ikonoklast

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.


Ernie

Aug 7, 2011 6:30 PM in response to koenraadfromleuven

Had the same issue (see https://discussions.apple.com/thread/3222521)


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)

Aug 9, 2011 4:00 PM in response to Omniver

I had the same problem with Mail syncing and was able to exclude the files as noted. Mail.app 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 Mail.app 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 Mail.app need to know these locations and they have to be the same for syncing to work.

Aug 9, 2011 11:01 PM in response to paquilina

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!


Koenraad

Aug 18, 2011 1:35 AM in response to koenraadfromleuven

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!


Koenraad

Mail index breaks at login after portable home sync

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.