Files
sharedinbox/lib/core/models/account.dart
T
Thomas GüttlerandClaude Opus 4.7 1a62907703 feat: default new SMTP accounts to implicit TLS (port 465)
The SMTP SSL/TLS toggle in the add-account form now defaults to on with
port 465. Previously the default was port 587 with the toggle off
(STARTTLS — TLS was active under the hood, but the off toggle made users
think the connection was insecure). The MX-record fallback in the
discovery service was flipped the same way; autoconfig XML parsing is
unchanged so servers that advertise STARTTLS still get STARTTLS.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 15:50:37 +02:00

45 lines
1.1 KiB
Dart

enum AccountType { imap, jmap }
class Account {
final String id;
final String displayName;
final String email;
final AccountType type;
// Used when type == AccountType.imap
final String imapHost;
final int imapPort;
final bool imapSsl;
final String smtpHost;
final int smtpPort;
final bool smtpSsl;
// Used when type == AccountType.jmap
final String? jmapUrl;
/// Login username for IMAP/SMTP/JMAP. Empty means fall back to [email],
/// then to the local part of [email] (the part before '@').
final String username;
/// When true, raw protocol traffic is captured and written to the sync log.
/// Never enable in production — logs contain sensitive data even after
/// credential redaction.
final bool verbose;
const Account({
required this.id,
required this.displayName,
required this.email,
this.username = '',
this.type = AccountType.imap,
this.imapHost = '',
this.imapPort = 993,
this.imapSsl = true,
this.smtpHost = '',
this.smtpPort = 465,
this.smtpSsl = true,
this.jmapUrl,
this.verbose = false,
});
}