Replace TLS checkbox with security dropdown (None/STARTTLS/SSL)

Replace the single IMAP TLS checkbox with a per-protocol security
dropdown for IMAP, SMTP, and Sieve. The security scheme (ssl:// or
tls://) is now stored directly in the host field, unifying the approach
across all protocols.

Smart form behavior:
- Default ports update automatically when changing security type
- Fields clear on blur when value matches the placeholder
- Warning shown when selecting no encryption
- Defaults: IMAP SSL/993, SMTP STARTTLS/587, Sieve STARTTLS/4190

The DB_SECURE_IMAP_TLS flag is no longer written but still read for
backward compatibility with existing records.
This commit is contained in:
Laurent Dinclaux
2026-02-10 17:54:36 +11:00
parent 780cfc6a7e
commit 36b9b3e35f
11 changed files with 368 additions and 133 deletions

View File

@@ -23,8 +23,8 @@ $labels['form.imap.caption'] = 'IMAP';
// Server host name
$labels['form.imap.host'] = 'Serveur';
// Secure connection (TLS)
$labels['form.imap.tls'] = 'Connexion sécurisée (TLS)';
// Security
$labels['form.imap.security'] = 'Sécurité';
// Port
$labels['form.imap.port'] = 'Port';
@@ -48,8 +48,8 @@ $labels['form.smtp.caption'] = 'SMTP';
// Server host name
$labels['form.smtp.host'] = 'Serveur';
// Secure connection (TLS)
$labels['form.smtp.tls'] = 'Connexion sécurisée (TLS)';
// Security
$labels['form.smtp.security'] = 'Sécurité';
// Port
$labels['form.smtp.port'] = 'Port';
@@ -70,6 +70,9 @@ $labels['form.sieve.caption'] = 'Sieve';
// Server host name
$labels['form.sieve.host'] = 'Serveur';
// Security
$labels['form.sieve.security'] = 'Sécurité';
// Port
$labels['form.sieve.port'] = 'Port';
@@ -111,6 +114,13 @@ $labels['form.notify.off'] = 'Désactivé';
$labels['form.notify.requires_newmail_notifier'] = 'Les notifications nécessitent le plugin newmail_notifier. Veuillez l\'activer ou contacter votre administrateur.';
// Security options
$labels['form.security.none'] = 'Aucune';
$labels['form.security.starttls'] = 'STARTTLS';
$labels['form.security.ssl'] = 'SSL/TLS';
$labels['form.security.none_warning'] = 'Les connexions non chiffrées sont vulnérables. Vos identifiants et emails peuvent être interceptés. Utilisez SSL/TLS ou STARTTLS autant que possible.';
// Errors
// Value in \'Server host name\' field is too long (64 chars max).