Email
Research
Email engineering guide

A provider-neutral email synchronization contract

Unified sync should standardize account state and change delivery while preserving the different cursor, folder, label, and notification rules of Gmail, Microsoft Graph, and IMAP.

Research surface only. This guide documents architecture and evaluation criteria; it does not describe a released DewEngine connector.
01
Contract

Normalize outcomes, not provider internals

Expose stable account, thread, message, participant, attachment, and container resources. Keep a provider extension beside them so labels, Graph categories, IMAP flags, and native identifiers remain usable and diagnosable.

02
Bootstrap

Make the initial sync bounded and observable

Let the product choose a time or message window, report pagination progress, and mark the account ready only after a coherent baseline is committed. A large mailbox should not block every other account.

  • Configurable history window
  • Per-account progress
  • Attachment hydration policy
  • Cancellation and restart
03
Incremental flow

Keep opaque provider state behind one checkpoint

Store Gmail history IDs, Graph delta links, and IMAP mailbox state as connector-owned cursors. Publish normalized changes only after the associated local data and next checkpoint are committed together.

04
Convergence

Assume notifications can duplicate or disappear

Webhook and push delivery is a hint, not the database. Deduplicate by event identity, schedule reconciliation, retain tombstones long enough to propagate deletes, and rebuild from the provider when a cursor is invalid.

  • Idempotent event application
  • Lag and cursor-age monitoring
  • Controlled full-resync path
Questions

Before you build.

What does 'real-time email sync' realistically mean?+

It means changes are normally detected soon after provider notification, with measured lag and a reconciliation fallback. It should not promise zero delay or perfect notification delivery.

Should provider cursors appear in the public API?+

Usually no. Expose a stable DewEngine checkpoint or event contract while retaining the opaque provider cursor internally for diagnostics and recovery.

Can I use DewEngine's email connectors today?+

Not yet. Gmail, Microsoft Graph, and IMAP/SMTP connectors are planned. This guide documents the intended architecture and the provider requirements a production release must satisfy.

Build with us

Does this match the workflow your users need?

DewEngine is in development. Real use cases decide what ships first.

Share your use case