Mac OS X Lion: Fix corrupt Mail folder








On Mac OS X Lion, it happened to me that the mail settings or messages were missing. Checked ~/Library/Mail folder, the messages are still there but I could not see them in Mac Mail. The solution for this is:
  • Quit your Mac Mail
  • Backup Mail folder:
    cp -r ~/Library/Mail /tmp/
    
  • Remove Envelope Index file:
    rm ~/Library/Mail/Envelope\ Index
    
  • Open Mac Mail application, it will import the messages automatically
  • Quit Mac Mail after import, then re-launch Mac Mail, you will see all the messages
  • Remove the backup if everything is ok:
    rm -fr /tmp/Mail
    



No comments:

Post a Comment