feat: ManageSieve STARTTLS + clearer TLS-mismatch errors + broader connection test
The "Email filters" screen was failing with WRONG_VERSION_NUMBER because the ManageSieve client was opening implicit-TLS sockets on port 4190, while RFC 5804 servers (Stalwart, Dovecot, Cyrus) listen plaintext on 4190 and expect STARTTLS. ManageSieveClient.connect now opens plaintext, reads the capability greeting, sends STARTTLS, hands the socket to SecureSocket.secure(), and re-reads capabilities on the encrypted stream. The same WRONG_VERSION_NUMBER error can hit IMAP/SMTP when the SSL toggle and the chosen port disagree (e.g. SSL=on with SMTP port 587). New helper lib/data/imap/tls_error.dart translates that BoringSSL error into a TlsModeMismatchException naming the host/port and suggesting which port goes with which TLS mode. connectImap, connectSmtp, and the ManageSieve TLS upgrade all funnel through rethrowAsTlsHint so the same readable message reaches the UI regardless of which protocol failed. ConnectionTestService previously only verified IMAP/JMAP, so SMTP and ManageSieve misconfig silently passed the "Try connection" button on the edit-account screen and only surfaced when the user later tried to send mail or open Email filters. After IMAP succeeds, the service now also verifies SMTP (always — sending mail requires it) and ManageSieve (only when manageSieveHost is explicitly set, since the section is collapsed by default). Failures are prefixed with "SMTP:" or "ManageSieve:" so the user can tell which leg of the connection is broken. connectionTestServiceProvider now also watches smtpConnectProvider so the E2E integration tests' plaintext SMTP override applies to the connection check as well. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
fc270590c4
commit
da383d0957