I've had all sorts of mail problems since upgrading to El Capitan about a week ago (mid-December 2015). I normally wait a long while before upgrading OS X to let a few rounds of bug fixes happen. Wish now that I'd stayed with Yosemite.
A lot of the problems I'm having seem to be similar to the problems people have with Exchange Servers and El Capitan Mail, but I just have two generic IMAP accounts.
Currently, everything is working fine with Mail, except that it freezes about every ten minutes and presents a modal dialog offering me the choice of 'quit' or 'quit and rebuild mail index'.
One interesting mystery was that my drive kept filling up. I was desperately trying to figure out what I could delete, but as soon as I made some free space, the drive quickly filled back up again.
I eventually figured out that Mail is filling up all the free space with its logs. Go to 'Connection Doctor' in the 'Windows' menu, and click the 'Show Logs' button. I had 110GB (!!!) of zipped mail logs there, all of which had collected in about three days.
So, if you're having slowdowns and losing drive space, it could be because of Mail logs. Check that folder and see what's in there. Some of those files are small, just a few kb, and some are multi-gig.
Every so often, Mail zips these log files, further hogging the processor to compress multi-gigs of data. In another forum, I saw a suggestion to change the permissions on the log folder to make it read-only. That does stop the logs and doesn't seem to cause any new problems, but for me the permissions keep reverting back as I've been messing with things.
Notice that in the Connection Doctor window you can disable logs — only the button doesn't work. Mail keeps writing those log files whether or not the button is checked.
Another thing to watch for — most of you who have been having trouble with Mail already know this, but see if 'automatically detect and maintain account settings' is checked under 'advanced' in your settings for each mail account. If this is checked, Mail may do things like change port numbers and security settings behind your back. You may have entered the correct settings, but then Mail changed and broke them.
I'm now using Thunderbird. When I upgraded to Yosemite I also had pretty bad mail problems, but not nearly as bad as this. As much as I like Apple Mail, after two frustrating rounds of OS X updates, I'm jumping ship.