Just a little one to keep me going for a while. Whilst upgrading a macbook to OSX Mavericks I noticed after restarting that the mail client was hanging, not crashing, but spinning at 100% cpu with the com.net.internetaccounts process.
After a bit of research it all boiled down to an error in the migration utility. What happened was the file /Users/..me../Library/Mail/V2/MailData/Accounts.plist had suddenly become huge (85Mb in this case). A plist is a list of properties that the software uses so normally this is a tiny file.
Digging into the file itself I noticed 1 of the existing mail accounts settings had been repeated 34000 times!! A short edit later to remove the duplicates and a restart of the mail process and all is well again.
Hope that helps someone out there! buy the research paper for biology