Here's what I have tried:
Adding account from preferences in Mail (BTW, the account works fine on my iPad). Used my full name, free iCloud (me.com) email address (which works fine on my iPad and on iCloud.com), and password. All checked and reentered multiple times for accuracy.
Result: "Logging in to the MobileMe IMAP server “mail.me.com” failed. Make sure the user name and password you entered are correct, then click Continue. If the information isn’t correct, you cannot receive messages."
Using my Apple ID instead of my full name, with the same email address and password.
Result: This allows me to set up the account. I get to the Account Summary page, having kept the default settings, entering passwords where necessary. I tick 'Take account online' and click 'Create'. Then, a dialog box comes up: Enter password for account "iCloud". The MobileMe IMAP server “mail.me.com” rejected the password for user “[myusername]”. Enter your password again or cancel. Entering the password makes the dialog go away...for a minute or so, and then it comes back. Even though I have entered the password and ticked "Remember this password in my keychain", the password field is blank. Repeat until my brain melts... Even pressing cancel doesn't stop the dialog from reappearing. Eventually it stops. I change my 'Full Name' from my Apple ID to my real name and take the account online. The same behaviour ensues. I delete the account. Unbelievably, I still get the dialog once more.
Using my Apple Support username instead of my full name again allows me to set the account up, but with the same results as above. As far as I can tell, it will only accept my Apple ID or support username, or a blank. The blank gives no joy either. Except, wait, I just tried and this time it accepted my real name, but only after rejecting my support username.
I've tried moving out all three preference files beginning with com.apple.mail from ~/Library/Preferences. Doesn't work, although interestingly, when I launched Mail it had my iCloud/MobileMe account set up already under my login username, which is different again. But I just get that dialog box again.
Going to System Preferences and trying to sign in to MobileMe doesn't work (I don't have a full MobileMe account, just the free email address, so assume this is why).
I note that when I do have the account 'set up', the incoming and outgoing mail servers differ to what is shown here: http://support.apple.com/kb/HT4864 . I can only edit the outgoing server, which does not help anyway.
I haven't been able to find anyone who's posted the same problem, so it's really beyond my knowledge to know what is happening here.
I hope someone can help me, I'd be grateful if I felt I could get moving again! I've never felt like I resented my Mac so much – usually I love it, even when it has problems.