How flectar/mail works
Flectar Mail is a native, local-first client for email, calendars, contacts, and files. The main path is account setup and provider synchronization into local storage, followed by inbox presentation; message composition and native HTML rendering are related user-facing workflows. The tree and README support the product boundaries and several integrations, while sampled source confirms selected sync, database, and file-service relationships. Many UI-to-core connections and calendar/contact internals were not excerpted, so those links are omitted or marked unverified.
Main entry points: engine.rs Account sync · mail.rs Inbox workspace · service.rs Files service · mod.rs SQLite database
Components 27
Native app
- Desktop entry
src/desktop.rs - Inbox workspace
src/mail.rs - Account setup
src/mail_setup.rs - Files workspace
src/files_controller.rs - Attachment preview
src/attachment_controller.rs - PDF preview
src/pdf_preview.rs
Mail workflows
- Message composer
src/compose_controller.rs
Core services
- Account sync
crates/flectar-mail-core/src/sync/engine.rs - Gmail sync
crates/flectar-mail-core/src/sync/gmail.rs - JMAP sync
crates/flectar-mail-core/src/jmap/sync.rs - IMAP service
crates/flectar-mail-core/src/imap/mod.rs - SMTP service
crates/flectar-mail-core/src/smtp/mod.rs - Calendar sync
crates/flectar-mail-core/src/caldav/sync.rs - Contacts sync
crates/flectar-mail-core/src/carddav/sync.rs - Files service
crates/flectar-mail-core/src/files/service.rs - File protocols
crates/flectar-mail-core/src/files/jmap.rs
Local data
- SQLite database
crates/flectar-mail-core/src/db/mod.rs - Data repositories
crates/flectar-mail-core/src/db/repo/messages.rs
Native rendering
- Email renderer
src/renderer.rs - HTML and CSS DOM
crates/blitz-dom/src/document.rs - Document layout
crates/blitz-dom/src/layout/construct.rs - Scene painter
crates/blitz-paint/src/render.rs - Text shaping
crates/parley/src/shape/mod.rs
Other components
- Mail user
- Mail providers
- CalDAV and CardDAV
- JMAP and WebDAV
Connections 27
- Mail user → Desktop entry: opens
README.md - Desktop entry → Inbox workspace: shows workspace
- Mail user → Account setup: connects accounts
README.md - Account setup → Account sync: starts sync
- Mail providers → Account sync: provides mail
README.md - Account sync → Gmail sync: dispatches
crates/flectar-mail-core/src/sync/engine.rs - Account sync → JMAP sync: dispatches
crates/flectar-mail-core/src/sync/engine.rs - Account sync → IMAP service: uses connections
crates/flectar-mail-core/src/sync/engine.rs - Account sync → Data repositories: reads and writes
crates/flectar-mail-core/src/sync/engine.rs - Data repositories → SQLite database: queries
crates/flectar-mail-core/src/db/mod.rs - Inbox workspace → SQLite database: reads local mail
- Mail user → Message composer: composes message
- Message composer → SMTP service: submits mail
- CalDAV and CardDAV → Calendar sync: syncs events
README.md - CalDAV and CardDAV → Contacts sync: syncs contacts
README.md - Mail user → Files workspace: browses files
README.md - Files workspace → Files service: requests operations
src/files_controller.rs - Files service → File protocols: uses protocol client
crates/flectar-mail-core/src/files/service.rs - JMAP and WebDAV → File protocols: serves files
README.md - Files service → SQLite database: persists file state
- Mail user → Attachment preview: opens attachment
- Attachment preview → PDF preview: opens PDF preview
src/attachment_controller.rs - Inbox workspace → Email renderer: renders messages
README.md - Email renderer → HTML and CSS DOM: parses email markup
README.md - HTML and CSS DOM → Document layout: constructs layout
crates/blitz-dom/src/document.rs - Document layout → Scene painter: provides paint tree
- Scene painter → Text shaping: draws shaped text
crates/blitz-paint/src/render.rs