OK, here's my story:
I re-installed OS X using the re-install partition. When that was done, Mail.app still had a problem. I noticed that my email address was entered as "me.com" instead of "mac.com", but changing it did not seem to work. Then I saw that I had a bunch of old alias email addresses that I don't use anymore, so I deleted all of those, and after that I had a pull-down menu of email addresses to choose from. I chose the "mac.com" address. At first it didn't seem that anything was happening, but when I went back to Mail.app I saw that my mailboxes were being re-filled, slowly. This process continues as I write, but the problem seems to be solved. How, I'm not sure.
It is definitely maddening, however, when Mail says to delete the iCloud account from System Prefs and System Prefs says to delete it from Mail and that pop-up window keeps popping up repeatedly. I did not find this to be a user-friendly experience.