If you use the mail application in OS X–which, by the way, has been greatly improved in Lion–you will want to migrate properly between versions when you upgrade the OS. In this case, we are going to be migrating form Snow Leopard to Lion. Before some ask “what for” know that a regular migration works fine for most users, but following the how to below will create an exact clone of your mail setup.
1) First, we advise you to always make a complete backup of your computer. In this case, it would be a backup of your OS X Snow Leopard setup. Do this before you do anything. Should something go wrong, you will want to have a working backup. We can’t stress the importance of this part enough.
2) Now you can update your computer. Don’t forget to create a USB install disc while you’re at it. It’s a lifesaver.
3) Do not use mail on your new setup yet. You don’t want it creating its own settings and keychain. From your Snow Leopard backup, you will want to copy (not move. This may seem obvious to some, but the difference is that by copying, you are not messing with the files that are in your backup drive. If you move said files, you can cause lots of trouble for yourself later) the “Mail” and the “Mail Downloads” folders which are in the user’s Library folder as well as your mail preferences, which are in Library/Preferences. You will also want to copy your keychains, which are located under Library/Keychains. These will all be copied to the same locations on your updated computer, so make sure they all make it into their respective folders.
Note: OS X Lion hides the library folder. Here’s how to find it.
4) You should now have all the files you need in the places you need. Double check. When you launch mail, it should now be an exact copy of your previous mail setup. This is because you copied your keychain, settings and preferences and Mail was none-the-wiser.