Email
Research
Email engineering guide

IMAP and SMTP integration beyond the major APIs

IMAP is a stateful mailbox protocol, not a REST API and not a sending protocol; a production connector must pair it with secure authentication, SMTP submission, capability discovery, and mailbox-specific sync state.

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

Use IMAP for access and SMTP for submission

IMAP lists and manipulates mailboxes and messages. Outbound mail requires SMTP submission or a provider API. Keep the two connection checks and error states separate even when the product presents one mailbox account.

02
Secure connection

Require modern TLS and prefer OAuth where supported

IETF guidance treats cleartext mail access and submission as obsolete and recommends TLS 1.2 or later, with implicit TLS preferred. OAuth can be carried through SASL, but server support and provider setup vary; never silently downgrade to cleartext.

  • Certificate validation
  • No cleartext fallback
  • OAuth/SASL capability check
  • Explicit provider configuration
03
Synchronization

Key messages by mailbox, UIDVALIDITY, and UID

IMAP sequence numbers can change during a session and are not durable IDs. A cached message identity must include the mailbox and UID validity state; when UIDVALIDITY changes, the connector must rebuild that mailbox's mapping.

04
Server variance

Discover capabilities before choosing algorithms

Servers differ in supported extensions, flags, folder conventions, limits, IDLE behavior, and authentication. Test capability responses, reconnect idle connections, reconcile periodically, and retain raw server responses for support.

  • Folder delimiter and special-use mapping
  • Flags and keywords
  • IDLE reconnect policy
  • UID and expunge reconciliation
Questions

Before you build.

Can an IMAP message sequence number be stored as a permanent ID?+

No. Sequence numbers can be reassigned. Use the mailbox plus UIDVALIDITY and UID, and rebuild the mapping if UIDVALIDITY changes.

Does IMAP support OAuth?+

The standards define SASL OAuth mechanisms, but each provider and server decides what it supports and how applications are registered. Capability and configuration checks are required.

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