Skip to content

IMAP: retry with exponential backoff on connection failures #199

@wesm

Description

@wesm

Context

The IMAP client in #193 makes a single reconnect attempt on network errors. For large mailboxes synced over unreliable connections (or servers that throttle aggressive clients), this can cause sync failures that require manual re-runs.

Proposal

Add configurable retry with exponential backoff for transient network errors:

  • 3 attempts with backoff (e.g. 5s, 15s, 45s)
  • Only retry on connection-level errors (EOF, reset, timeout) — not auth or protocol errors
  • Log each retry attempt at warn level

The retry logic could live in withConn() or a wrapper around the connect/reconnect path.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions