@notio Looks like I didn't fare too badly once I found the right phrase to Google. Will take a while to resync IMAP, though.
The normal Apple Mail database rebuild didn't restore accounts. What did was deleting the Container.plist file in Mail's sandbox container.
@elliotclowes @mailmateapp Yep. Lots to like about MailMate, but I'm not ready to switch.
Not sure what happened, but Apple Mail just spontaneously lost all my mail accounts (even though they are still in the prefs file).