There is nothing to set up for iCloud accounts. You should not do that manually. When you sign into iCloud with your Apple ID, you can check the box to use Mail and the account will automatically set up for you in Apple Mail. It is an IMAP account and will sync between all devices.
If you did set them up manually, sign out of iCloud. Open Mail's account preferences tab and delete the iCloud account. Then sign into iCloud with your Apple ID and select to use mail and the account will set itself up in Mail.
Hmmm ... Thanks for the quick reply, but the problem remains. I did as instructed and the pattern with iCloud repeated itself. I removed the iCloud account from Mail. I logged back into iCloud and selected "use Mail", and the setup process failed with the following message (same as before):
Cannot set up Mail from the iCloud pane. Open Mail preferences and set up an iCloud account manually.
Any ideas as to why the iCloud gods are picking on me?
Seems you have something wrong with your system. Log out of iCloud account from System Preferences. Make sure there are no iCloud accounts in Mail.
Surely you don't have the same problem with both computers.
On the computer with the problem:
Open up your Home Library folder. This is hidden in ML. To get to it, go to the Finder menu, select Go, then Go to Folder. Paste this:
A Finder will open in your home Library folder. Look for any folder beginning with AosIMAP. Move them to the trash. Look for any other account that would be associated with an iCloud account and move them to the trash.
When logged out of iCloud, these folders shouldn't exist in the Mail/V2 folder.
Open Disk Utility and do a permissions repair. Restart the computer and go back and sign into iCloud and see if the problem still exists.
No ... as stated in the opening question, I am running Lion on my iMac and Mountain Lion on my MacBook Pro. It is the latter on which I seem to have a problem. I now see that your assumption that I was running ML on both may have led to some confusion between us. Let me explain.
First, my problem is now corrected, at least functionally ... thanks to you, but also to the Genius Bar at my local Apple Store a bit of circumspection on my part. He advised me that I had two accounts with Apple, each with its own ID. The account on the iMac was firstname.lastname@example.org and that on the MacBook Pro was email@example.com.
Second, once I removed and replaced the former with the latter account on the iMac, a properly behaving (i.e. synchronized) Archive folder appeared on the MacBook Pro. But it did NOT appear in the side bar under the ICLOUD heading. It appeared under an undifferentiated MAILBOXES heading instead. If I had not inspected the sidebar carefully, I might well have missed it.
Third, it appears to me as if ML does not show in its MAILBOXES sidebar any distinction between ON MY MAC and ICLOUD categories of user-created mailboxes. I'm not sure that I understand this. At this point I am not sure which email folders are on my Mac, and which are in the "Cloud." Does this sound like progress?
Archive folder in ML appear under the main mailboxes. I haven't been in Lion since ML came out, but I believe it appears under the iCloud imap folder in the sidebar. Really doesn't make a difference, they accomplish the same.
If you are unsure what is appearing in the local On My Mac section, place the cursor over it in the sidebar. A selection will appear to hide the folders within. Click on hide and you will see what is what. Anything above in part of the main mailboxes. Anything below should be within imap folders.