In macOS 15.5, where does Apple Mail keep its account settings?
I'm having trouble setting up a new email account in Apple Mail on macOS 15.5.
The account uses regular IMAP and SMTP using password auth over TLS, "other" in the setup dialogue.
I enter all the details (domain changed to protect the innocent in this screenshot), and it tries to verify the connection, which fails.
I used the connection doctor to enable logging, and in the logs I can see that it's ignoring some of my settings and trying to connect improperly, for example it's trying to connect over IMAP on port 143 (insecure IMAP), and SMTP on port 0, despite my settings changes.
What's also annoying is that while it's not working, it refuses to save my settings, meaning that if I close this window, I lose nearly everything that's entered.
From the same machine, I've logged in successfully to the target server over IMAP and SMTP directly, on the same ports, over TLS, using an openssl client in a terminal. i.e. all the settings are correct, and it responds essentially instantly, whereas mail seems to be waiting 30 sec for TCP timeouts. I have other accounts in Mail that uses a similar manual IMAP config and they work fine.
So I'd like to try altering the settings on disk, which I assume are lurking in a .plist or sqlite DB somewhere. Where can I do that?
Mac Studio, macOS 15.5