Since release of High Sierra, this feature of Mail is broken. Mail > Preferences > Accounts > pick IMAP account > Server Settings > Advanced IMAP Settings. When you check the box to enable, and close the popup, it doesn't save the setting.
Maybe it's debatable whether you should access a mail server on your local network without encryption, but the setting is there, so it should work. And it did, until High Sierra.
There's been a discussion at Apple for months:
https://discussions.apple.com/thread/8087473
With the structural changes in how Mail save prefs over last few OS iterations, I've seen where the preference used to be stored, but that isn't where it is now. Does anyone know where High Sierra stores the prefs for Mail accounts, particularly this preference?

