I have a similiar problem. But I am still trying to figure it out. I can access some of my mailboxes on the server where my profile is running, but I can't access them from my laptop using this profile. Seems a bit strange.
Well another post in the forum suggested making sure iCloud (if you have it) is set to Apple Token in the Advanced tab in the Accounts preferences window in Mail. iCloud is working for me now but other IMAP services aren't and getting the same error message.