After searching the web and Apple's support site with no luck I devised a plan to trash the ~/Library/Preferences/com.apple.mail.plist file and then manually rebuild the accounts. The mail in folders is unaffected by doing this but I made a backup just in case.
Before going to all this trouble we called AppleCare and we were bumped up to a Mail engineer that approved of my plan. But while talking we decided it was worth seeing if we could get the old iMac to re-write the prefs, then copy them to the new iMac.
I created a new email account on the old system. Closed Mail, which apparently did force Mail to re-write the preferences file, and copied the prefs over and it worked! The file's corruption was fixed.
Since this wasn't documented anywhere I decided to blog it myself.