Similar issue. iOS Mail has stopped working with update to iOS 18. Connects to Dovecot server on internal network using WiFi or VPN.
Existing mail accounts get the "Cannot Get Mail" error, "bad certificate format" -9,808.
The server certificate was working with iOS 17 and has SAN fields for DNS and IP set. Root CA certificate installed on iPhone and trusted.
I deleted and reinstalled one of the email accounts on the iPhone. For the reinstalled account, I don't get a -9,808 error in the Mail app, instead the app shows "No Mail" and the server's mail log has hundreds of entries like:
:
Dec 6 15:40:23 mailsrvn2 dovecot: imap-login: Disconnected: Connection closed: SSL_accept() failed: error:0A000416:SSL routines::sslv3 alert certificate unknown: SSL alert number 46 (no auth attempts in 0 secs): user=<>, rip=192.168.5.52, lip=192.168.2.21, TLS handshaking: SSL_accept() failed: error:0A000416:SSL routines::sslv3 alert certificate unknown: SSL alert number 46, session=<6R1H1ZsoDv/AqAU0>