Debugging mail has become a bit cumbersome since the program is now designed to do all of the network requests on background threads and the main UI never blocks. Worse, I don't think there's any way to see important statistics like: What percentage of network requests time out or error? What is the response time for my mail server over time.
With that being said, here are the things I do to isolate and debug mail.
- Ensure my Mac has accurate time by enabling Set date and time automatically and manually making the time wrong in the past by 1 minute or more and then enabling the check to ensure my clock will be close to the clocks on the Mail servers.
- Make a new user account and only enter one Mail account in that user. This lets me log out of my main user and really focus on one mail server (actually two - one for receiving and another for sending) and makes the debug logs much easier to parse.
- In the new account, I don't sign in to iCloud, and when I'm setting up the Mail account, I disable the check mark for Mail and only select Notes - I just want to test the log in and log out first without downloading all the mail initially.
- Open up Connection Doctor (under the Window menu or use help to find it)
- Enable Log Connection Activity
- Press Show Logs
You will now have more data than you might like, but watch for the green light status of the Internet Connection and the status / errors of IMAP/SMTP and other items in the doctor window.
If I don't have a problem and all the lights are green, I quit make and use Finder to navigate up one folder from the logs and compress the entire Mail folder. That gives me a baseline of when things worked.
At that point, if there is an error, you can dig into the logs or post here. You could engage AppleCare or your mail provider for help - and now you have logs. Asking a follow on question with some error message from the logs might also be worth while here. (Or even ask what the various logs mean).
If there isn't an error on the new account, log out of the test Account on your Mac and log back in to your main account and repeat the connection doctor steps. Enable logs there if you find a problem.