Thomas Güttler and Claude Sonnet 4.6
0e2021f343
Fix integration tests: allow plain-text auth in Stalwart dev config
...
Stalwart 0.14 disables PLAIN/LOGIN on non-TLS ports by default:
- [imap.auth] allow-plain-text = true → unblocks IMAP LOGIN
- [session.auth] mechanisms + allow-plain-text → advertises PLAIN/LOGIN on SMTP
Also fix test: SMTP authenticates as "alice" not "alice@localhost"
(Stalwart SMTP auth accepts username without domain, unlike IMAP login)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-16 10:08:05 +02:00
Thomas Güttler and Claude Sonnet 4.6
818f66c738
Fix dart→flutter in CI; add pre-commit hook and install-hooks task
...
- ci.yml: dart run/dart test → flutter pub run/flutter test (all 3 jobs)
- hooks/pre-commit: runs flutter analyze + flutter test before every commit
- Taskfile: add install-hooks task (copies hooks/pre-commit → .git/hooks/)
- LATER.md: remove resolved items (enough_mail fork, pre-commit, GH CI)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-16 09:55:15 +02:00
Thomas Güttler and Claude Sonnet 4.6
da38948652
Fix dart→flutter test in integration script; add task build-android
...
- stalwart-dev/test.sh: dart test → flutter test (project requires Flutter SDK)
- Taskfile: add build-android task (flutter build apk --release)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-16 09:43:24 +02:00
Thomas Güttler and Claude Sonnet 4.6
427ba5d0ac
PLAN.md: simplify phase 0 — enough_mail comes from pub.dev
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-16 09:38:54 +02:00
Thomas Güttler and Claude Sonnet 4.6
2f93ae3638
Use upstream enough_mail 2.1.7 from pub.dev
...
No fork needed — our changes were correct API usage, not workarounds.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-16 09:38:46 +02:00
Thomas Güttler and Claude Sonnet 4.6
8a37ca129f
PLAN.md: mark phase 0a (enough_mail fork) as Done
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-16 09:35:04 +02:00
Thomas Güttler and Claude Sonnet 4.6
79ee498879
Switch enough_mail from vendored path to forked git dependency
...
- pubspec.yaml: path: packages/enough_mail → git: guettli/enough_mail
pinned to SHA 25320ada (same version as the vendored copy)
- Remove packages/enough_mail/ (170 files, 38k lines) from this repo
- Fix .gitignore: restore comment, add coverage/ (generated by --coverage)
- PLAN.md: document phase 0a
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-16 09:34:55 +02:00
Thomas Güttler and Claude Sonnet 4.6
71952ed36b
Fix: vendor enough_mail as regular files instead of gitlink
...
The directory was tracked as a mode-160000 gitlink (bare submodule
reference) without a .gitmodules entry, causing 'has no commit checked
out' errors on commit. Re-added as ordinary tracked files so the
vendored copy is fully part of this repo.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-16 08:52:01 +02:00
Thomas Güttler and Claude Sonnet 4.6
0e5b7ea0ea
Fix: remove redundant DateTime month/day args (avoid_redundant_argument_values)
...
DateTime(2024, 1, 1) → DateTime(2024) since month and day default to 1.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-16 08:50:39 +02:00
Thomas Güttler and Claude Sonnet 4.6
ea324a3cdd
Add coverage gate to task:test, bring unit coverage to 100%
...
- flutter test --coverage generates coverage/lcov.info; awk script
computes line coverage and fails if below threshold (currently 100%)
- Add Email, EmailBody, EmailAttachment constructor tests to cover the
3 previously uncovered lines in email.dart
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-16 08:43:32 +02:00
Thomas Güttler and Claude Sonnet 4.6
662acb42cb
Fix: use flutter test/flutter pub run instead of bare dart commands
...
The project depends on the Flutter SDK so dart pub/dart test fail with
"version solving failed". Switch task:test to flutter test and
task:codegen to flutter pub run build_runner.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-16 08:38:09 +02:00
Thomas Güttler and Claude Sonnet 4.6
4e03483126
Fix API mismatches, lint violations, and test failures
...
- enough_mail: use uidFetchMessage/uidMarkSeen/uidMarkFlagged/uidMove/
uidMarkDeleted/uidExpunge, remove non-existent isUidSequence param,
fix SmtpClient construction and use quit() not disconnect()
- Drift: add @DataClassName('MailboxRow') to avoid ugly 'Mailboxe',
alias core model imports to resolve type name conflicts
- EmailsCompanion.insert: uid/receivedAt are required, not Value<T>
- Lint: remove unrecognised rules (prefer_const_collections,
avoid_returning_null_for_future), add missing mounted guards after await
- Tests: fix html_utils expectations to match trim() behaviour,
add explicit Map casts in email_model_test for avoid_dynamic_calls
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-16 08:21:14 +02:00
Thomas Güttler and Claude Sonnet 4.6
03d35387f7
Linting, tests, README, CI, and code quality improvements
...
Linting:
- analysis_options.yaml: flutter_lints base + 20 additional rules
(prefer_single_quotes, avoid_print, cancel_subscriptions,
unawaited_futures, empty_catches, always_declare_return_types, …)
- unused_import / dead_code treated as errors
pubspec.yaml:
- Remove 6 unused packages: freezed, freezed_annotation, json_annotation,
json_serializable, riverpod_generator, collection
- Add test: ^1.25.0 for pure-Dart unit tests
Testable utilities (extracted from screen code):
- lib/core/utils/html_utils.dart — htmlToPlain()
- lib/core/utils/format_utils.dart — fmtSize()
- lib/core/utils/logger.dart — thin debugPrint wrapper
Unit tests (test/unit/, no device required):
- html_utils_test.dart — 13 cases covering tags, entities, edge cases
- format_utils_test.dart — B / KB / MB / GB formatting
- email_model_test.dart — EmailAddress JSON roundtrip, toString, EmailDraft
- account_sync_backoff_test.dart — exponential backoff + clamping
Taskfile:
- task test → dart test test/unit/ (fast, no device)
- task test-flutter → flutter test (widget tests)
- task check → analyze + unit tests in parallel
README rewrite:
- Covers user flow (download, add account)
- Developer flow: nix develop, direnv allow, task codegen, task check
- Platform status table (Linux done, others pending)
- Project layout diagram
- Schema-change workflow
CI (.github/workflows/ci.yml):
- analyze-and-test job: flutter analyze + dart test on every push/PR
- integration job: Nix + Stalwart on push to main
- build-linux job: flutter build linux --release
Logging:
- Replace all bare catch (_) {} with log() calls
- Sync backoff errors now print account email + retry delay
- STATUS failures on \Noselect mailboxes logged at debug level
- STARTTLS failures logged before continuing without TLS
.gitignore:
- Add .direnv/, .flutter-plugins-dependencies
- Add all platform generated-plugin wiring files
- Add .env / .env.local
- Add linux/build/
.env.example: documents optional STALWART_PORT overrides
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-16 08:11:29 +02:00
Thomas Güttler and Claude Sonnet 4.6
72e2b599bf
Fix API mismatches, add Linux desktop entry point, reply prefill
...
API fixes (against vendored enough_mail 2.1.7):
- listMailboxes() returns List<Mailbox> directly — remove .mailboxes
- Use statusMailbox() for unread/total counts per mailbox
- fetchMessages(MessageSequence.fromAll(), ...) replaces nonexistent
fetchAllMessages(); fetchMessage() takes isUidSequence flag
- FetchImapResult.messages are already MimeMessages — no need to
re-parse rawData; use msg.decodeTextPlainPart() / decodeTextHtmlPart()
- msg.hasAttachments() (method) not msg.body?.hasAttachments (field)
- SmtpClient clientDomain = sender domain, not display name; quit()
instead of nonexistent disconnect(); STARTTLS wrapped in try/catch
- ContentInfo.size is nullable; use a.fileName / a.size getters
Other fixes:
- main.dart: move sync start to initState, not build()
- account_list_screen: remove dead/invalid Riverpod select() code
- account_sync_manager: subscribe to account changes; cancel sub on
dispose; use Future.any([newMsg, 25-min timeout]) for IDLE
- email_repository: add getEmail(id) to interface + impl
- email_detail_screen: load header + body together via Future.wait;
reply prefills To/Cc/Subject correctly
- compose_screen + router: thread prefillCc through
Add Linux desktop entry point:
- linux/CMakeLists.txt, main.cc, my_application.h/.cc (GTK3 runner)
Add flake.lock (generated by nix flake update).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-16 07:51:52 +02:00
Thomas Güttler and Claude Sonnet 4.6
22db4a2dd6
Add Nix flake, .envrc, Taskfile, and Stalwart dev server
...
- flake.nix: Flutter 3.41.6, Android SDK, Stalwart, GTK3/build
tools for Linux desktop, go-task
- .envrc: copied from sharedinbox — use flake + dotenv_if_exists
- Taskfile.yml: analyze, test, integration, codegen, run tasks
- stalwart-dev/: IMAP+SMTP dev server reused from sharedinbox
- test/integration/imap_sync_test.dart: login, list mailboxes,
send via SMTP and receive via IMAP
- pubspec.yaml: add flutter_secure_storage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-16 07:40:34 +02:00
Thomas Güttler and Claude Sonnet 4.6
5ebda521d6
Initial Flutter/Dart port of SharedInbox
...
IMAP/SMTP email client with offline-first architecture:
sync engine writes to Drift (SQLite), UI reads reactively
from the local DB. enough_mail vendored under packages/.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-16 07:35:56 +02:00