Files
sharedinbox/lib/core/models/account.dart
T
Thomas GüttlerandClaude Opus 4.7 fc270590c4 feat: ManageSieve (RFC 5804) Sieve script editing for IMAP accounts
Adds a minimal ManageSieve client so the existing "Email filters" UI
works for IMAP accounts, not just JMAP. SieveRepository becomes a
dispatcher that routes to JMAP or ManageSieve based on account.type.

Account model + DB schema v15 grow manageSieveHost/Port/Ssl fields
(default 4190 / TLS, host falls back to imapHost when blank). The Add
and Edit account screens expose them inside a collapsed ExpansionTile
to keep the form short for users who accept defaults.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 06:53:31 +02:00

54 lines
1.4 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;
/// ManageSieve host (RFC 5804). Empty falls back to [imapHost].
/// Only consulted when [type] == AccountType.imap.
final String manageSieveHost;
final int manageSievePort;
final bool manageSieveSsl;
// 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.manageSieveHost = '',
this.manageSievePort = 4190,
this.manageSieveSsl = true,
this.jmapUrl,
this.verbose = false,
});
}