Mail App timing out and having trouble getting and sending mail
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.
TL; DR - your mail issues are the same as my Mail issues and I'm not using exchange, but I do use an IMAP mail server in France which is across the atlantic from where I typically work. My suspicion is that the network errors and time outs are happening and I don't get good feedback when these errors happen and instead Mail hides all the evidence, diligently re-trying a slow connection and in the end making me unhappy. I'm looking to see if I can gather mail statistics so that I can monitor health of my mail connections in aggregate and then choose a faster mail server based on evidence, but so far, I'm only able to find out when the servers are down as opposed to being too slow to effectively work, but up enough to answer Mail's patient requests within 2 minutes so I don't actually get a "failure to connect".