I'm totally baffled by the changes Apple made on iOS18 about certificates usage in the built-in mail application. They decided that self-signed are not accepted any more, fine. As long as you can install your own root CA and trust it, it should be fine. But NO! They have also decided that mail will only accept IMAP servers using a domain name, no more just and IP address. So you can't get any IP-based certificate that will be accepted by the mail app, even with the right SAN and al. I've tried two "identical" certs, one with a domain and one with an IP and the domain works while the IP fails, being rejected as non-valid by the app. The most funny part is that the IP cert is good enough to configure mail (can see the successful login), but is being rejected when reading emails. I'm really fed up with the "Apple police" that wants to push us not using our own storage anymore. My se case is simple, I have an IMAP server that is used by family to archive all emails and keep them organized, saved forever and away from being scanned. I need to access that server either when locally connected or through VPN. For VPN, I use split tunnels because I don't want all traffic to go to tunnel. Nor do I want to create my own local DNS server and have all VPN clients use such DNS server only for the sake of having a domain name for the IMAP server. Nor do I want to open an external port to redirect to my IMAP server (that works of course as then I can use DDNS ...). Talk about increased security!
This is insane