I'm reviving this discussion as I've run into problems again after a long-delayed upgrade from OS 10.11 to 10.12, long delayed because I was afraid it would screw up my emails again. It did.
The upgrade to 10.12.5 went smoothly but when I ran Mail for the first time I got an error message and an offer to reimport mailboxes and messages, which I clicked and which happened. Problem was that the imported messages only went up to late 2015. Nothing since.
I spent a fruitless 30 minutes on the phone to the Apple help service (very useful sometimes - long may it continue) at which point the line dropped. I don't think the service agent understood what was going on. From there I took things into my own hands and reimported all the mailboxes from a current (SuperDuper) backup - labourious, but I think all the messages were restored. Mail seems to be working fine now.
This is similar to the problems I had when I upgraded from 10.10 to 10.11 but Mail worked well after I'd sorted that, until yesterday's upgrade. I have to assume that the earlier upgrade introduced a problem in the structure of the Mail setup. After the earlier upgrade I found two folders within Library/Mail, V2 and V3, and I was never sure which was the currently active one. After yesterday's upgrade there were V2 and V4, V3 having disappeared. The mailboxes I reimported from backup and which had the up-to-date messages came from the pre-update V2 folder.
It would be nice to think that things will be all fine and dandy when it comes to another OS update but I am sure that that won't be the case. I would like to be able to find someone at Apple who can understand what has happened and if there is a proper fix but so far that's not been the case.