Avast and Mail in El Capitan...
For anybody having problems with Mail in El Cap... another potential fix...
I was agonizing over Mail's massive log files and getting stuck on "Downloading 1 message..." etc. too. I deleted the log files, reset my iCloud account, reset Mail, had to wait a day or three for all my emails to re-sync, etc. I also spent periods with Apple trying to find a solution. No luck.
And then I looked at the Console logs while opening mail... and saw an error message about IMAP from a virus-checker I was running, "Avast."
I stopped Avast from filtering mail.
And every problem I was having suddenly stopped. Frankly, I went ahead and deleted Avast from the computer, just to be sure. Since then, no problems whatsoever. I know that might not be the source of everybody's issues with the program. But it's made such a huge difference for me, I wanted to pass it along.
Can't imagine why that would be the issue, but there you have it.
Hope it helps someone!
MacBook Pro with Retina display, OS X El Capitan (10.11.1)