I had the same issue. And tried everything written here... it didn't work... But i solved it in another way, maybe it will be helpful.
So my goal was to move all my mail from old MBP 2011 Mavericks to new MBP El Capitan. I have 5 mail accounts(boxes).
after several attemts to move some library files and folder (Mail, mail download etc) it didnt't work.
0 So i just opened a brand new mail app, and added (logged in) all my accounts manually. Fortunately google and some other accounts automatically downloaded all my mail history including sent files (it took me couple of hours).
But unfortunately one account didn't want to download it's history and sent files.
I did the following:
1 On old MBP Mavericks, at mail app, i right clicked on this account incoming mail box icon -> exported mail box to usb drive
2 Then i did the same to the sent files of this account mail box (on the left side of a sent mail icon (paper plane) there is an arrow sign. Click on it and you will see divided boxes with sent mail for each of your account. Chose the one you need, then right click and export to your usb/external drive.
3 Then i plugged usb drive to the new MBP El Capitan. There i opened mail app, then -> File -> import mail box -> picked 1st file with incoming mail (you will need to wait plenty of time (10k mails took me about 1,5 hours)
4 Then you do the same with the sent mail on your usb drive... wait patiently.
5 Once all boxes are imported to your Mail app, you can see them in the bottom in a import folder.
6 Pick the 1st imported mail box (that one with incoming mail), you see all your messages. Pick all of them - cmd+a or holding the shift key pick first and the last message -> right click -> move to -> chose the mail box account where you want to move them. (you will have to wait....)
7 the same for sent files. Choose them all, then right click and move them to the sent mail folder of your account.
This is very boring and time consuming method (especially if you have a long mail history) but it worked for me.
All income and sent messages are in place including attached files. Search bar works.
The only bad thing - no flags/tags for email were transferred, no vip contacts... you'll need to do it again manually.
Hope this will help you. Good luck!
PS
Hope apple will fix this issue in the future and make mail migration easier.