The issue sprang up around June 24-25, the time that matched Apple's system status report, concerning the iCloud Mail outage. The latest received messages in both iCloud accounts of mine are dated June 24. Since that day, iCloud is no more.
I spent the entire week with ChatGPT trying painstakingly every potentially sound and viable solution - all in the realm of open-source Unix utilities, of course.
AI helped forge a smart strategy, revolving around the idea of tunnelling IMAP responses (since the disruption occurred with Incoming Mail: SMTP shows up as being online) through a custom local port. It purported to make up for irregularities that arose from what it diagnosed as being caused by missing legit root CA certificates on my machine, notably USERTrust by Sectigo. Restoring even the downloaded verified copy on Mac isn't possible since this troubled cert must be in SystemRootsCertificates.keychain, and macOS forbids meddling with this keychain. Drawing on newly downloaded copies of root and intermediate cert, the two forming a legitimate chain (USERTrust + Apple Public Server CA 1 G 11), combined with locally generated private key and dummy certs, it was thought to spoof Apple Mail to not bother checking the validity of UserTrust.
No way.
The brunt of these tasks fell on a utility called stunnel.
The plan was simple, yet elegant. stunnel was to:
The last point was where it faltered. AI suggested the following (it may be of interest to active members of this forum and users of old macOS, such as Mavericks, which was the testbed of anything laid out below; credit goes to ChatGPT):
# Outline
# Underperformance analysis and suggestions
# Failure analysis (testing involved openssl and other networking tools)
# Connection Doctor
The week of troubleshooting ended with AI bringing up Apple overhauling the entire authentication framework, which inevitably impacted the iCloud platform. The factor of 2FA, 2-step, or, equally, the absence thereof was proved negligible. With Apple tightening screws and deploying even harsher if not more sophisticated and controlled security infrastructure, all familiar methods seem to not leave even the slightest mark once they decided to phase you out.
Practically, as of this minute, I've been cut off from my iCloud mail messages completely. Google's still operating normally.
I spent the entire week with ChatGPT trying painstakingly every potentially sound and viable solution - all in the realm of open-source Unix utilities, of course.
AI helped forge a smart strategy, revolving around the idea of tunnelling IMAP responses (since the disruption occurred with Incoming Mail: SMTP shows up as being online) through a custom local port. It purported to make up for irregularities that arose from what it diagnosed as being caused by missing legit root CA certificates on my machine, notably USERTrust by Sectigo. Restoring even the downloaded verified copy on Mac isn't possible since this troubled cert must be in SystemRootsCertificates.keychain, and macOS forbids meddling with this keychain. Drawing on newly downloaded copies of root and intermediate cert, the two forming a legitimate chain (USERTrust + Apple Public Server CA 1 G 11), combined with locally generated private key and dummy certs, it was thought to spoof Apple Mail to not bother checking the validity of UserTrust.
No way.
The brunt of these tasks fell on a utility called stunnel.
The plan was simple, yet elegant. stunnel was to:
Terminate TLS from Mail.app
Connect securely to imap.mail.me.com:993
Avoid certificate/trust problems (e.g., USERTrust issues)
Provide Mail.app with a clean local connection endpoint, e.g., localhost:1993
The last point was where it faltered. AI suggested the following (it may be of interest to active members of this forum and users of old macOS, such as Mavericks, which was the testbed of anything laid out below; credit goes to ChatGPT):
# Outline
Squid’s SSL bump is primarily affecting HTTP/HTTPS traffic (like rich content in emails or web browsing). It might be interfering if Mail's configuration ever ended up redirecting IMAP traffic through it, but normally Mail’s IMAP (port 993) would be separate.
stunnel’s purpose here is to isolate and reliably handle the TLS termination for Mail’s IMAP connection. If Apple changed something about the TLS parameters on their iCloud IMAP servers (which seems likely if Mail stopped working), using stunnel to manage that connection separately can make a significant difference.
Even if Mail was indirectly affected by Squid's handling of HTTPS (for embedded images, etc.), stunnel addresses the core mail protocol (IMAP) which is a different channel. This separation can help ensure that Mail either connects properly or fails consistently in one area, rather than mixing protocols with conflicting termination setups.
So yes—if your issue with iCloud connectivity is primarily with IMAP/TLS, employing stunnel to isolate and correctly terminate that traffic should help. It creates a dedicated, controlled environment for Mail’s non-web traffic, which is likely to restore connectivity if the problem stems from a certificate/trust chain mismatch introduced by external changes.
# Underperformance analysis and suggestions
stunnel.conf is set up correctly to perform a full TLS client connection to imap.mail.me.com:993, and listen locally on 127.0.0.1:1993 as an SSL-wrapped IMAP server.
But the problem is Mail.app (and openssl s_client) are sending a TLS ClientHello — which is wrong because your stunnel listener on 1993 is already decrypting TLS. That port expects plaintext IMAP — the same as what Apple Mail would speak after negotiating TLS.
Therefore, Apple Mail must be configured to use no SSL for localhost:1993, since TLS is already handled by stunnel.
# Failure analysis (testing involved openssl and other networking tools)
Why OpenSSL fails
When you run:
openssl s_client -connect localhost:1993
…it sends a TLS ClientHello — but the stunnel listener at 1993 expects raw IMAP, not a TLS handshake.
Hence the error:
SSL routines:tls_get_more_records, packet length too long
It’s like trying to speak encrypted to someone already decrypting — they hear gibberish.
# Connection Doctor
You're seeing:
AUTHENTICATE PLAIN
in Connection Doctor logs, and:
openssl s_client -connect localhost:1993
...
error:...SSL routines:tls_get_more_recordsacket length too long
These both confirm the issue:
Apple Mail is still trying to use SSL on port 1993
Despite unchecking “Use SSL” in the account settings, Apple Mail is wrapping the connection in TLS anyway. That’s why:
stunnel receives plaintext IMAP from iCloud.
But Apple Mail sends a TLS handshake, which stunnel forwards unmodified — iCloud’s IMAP server, expecting plaintext, breaks with packet length too long.
The week of troubleshooting ended with AI bringing up Apple overhauling the entire authentication framework, which inevitably impacted the iCloud platform. The factor of 2FA, 2-step, or, equally, the absence thereof was proved negligible. With Apple tightening screws and deploying even harsher if not more sophisticated and controlled security infrastructure, all familiar methods seem to not leave even the slightest mark once they decided to phase you out.
Practically, as of this minute, I've been cut off from my iCloud mail messages completely. Google's still operating normally.
Last edited: