Here’s a little tip for fellow users of Apple Mail on a Mac.
For some time since upgrading my Mac to OS X 10.10 Yosemite, its Mail app had been misbehaving. It seemed unexpectedly slow. Sometimes when I deleted a bunch of messages, some or all of them would undelete themselves a few seconds later, often when I had moved on to another Mail folder. Problems like these would come and go; sometimes it was OK, sometimes not. Malaise affected both my personal email account and my work account.
The cause turned out to be the same for both accounts: Mail was trying to use port 143 for IMAP, despite the fact that it was also trying to use SSL. SSL IMAP should go through port 993, not port 143. Horrible misconfiguration. It didn’t just fail, though. Somehow it kind of stumbled along, behaving just well enough that I didn’t guess for a while that there was a configuration problem at all.
At the suggestion of the tech support people at my personal email provider I tracked down and unticked the Mail account setting to “Automatically detect and maintain account settings”. There’s one of these for each incoming and outgoing mail account you have configured in Mail. I had two IMAP servers and three SMTP servers configured, and I’ve deselected that setting for all five of them. Once that’s done, unticking the “SSL” box then ticking it again is enough to set each configuration back to using its proper port.
As soon as I’d made that change, Mail was transformed back into the beautiful thing it used to be: everything happens instantly, it handles complicated mass deletes with the greatest of ease, it files mail into folders with no perceptible wait, despite all the filtering rules I’ve burdened it with; mail sends at the first time of asking, without any argument or backchat from Mail. Life is good once more.
Postscript: I see from a brief web search that I’m not the only one affected by this! See for instance: