Mac OS X is sometimes a pain. The system delivers a lot of awesome futures, but more futures will bring more problems. OS X Yosemite Mail problems are well known by many users.
My own mail server is based on Courier, Dovecot and some other services and I never have had any problems with this setup.
But from time to time my outgoing and ingoing mail traffic was broken with Mail on OS X Yosemite. I never changed the configuration – also why, when it’s working very well? So why does it stop working?
But as Apple always says: There are no problems with their software. So what can we do? Apple says: Create a backup and reinstall your system. Funny joke by Apple? No. But I have found a solution that works very well for me – without editing the raw config files, reinstalling the complete system or what ever for crazy and time wasting methods.
And now disable the automatic detection of the account settings inside the mailbox settings – for both: IMAP/POP and SMTP!
Be sure using the right configuration for your mailbox account (port, SSL option, authentication type, …), otherwise it won’t work.
The Mail application has reconfigured my mailbox account settings from time to time and I don’t know why. But disabling the automatic detection option did the trick! OS X Mail runs fine and stopped messing up again.