imapsource

package
v0.2.47 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package imapsource is the IMAP source kind: it connects OUT to a remote IMAP mailbox a tenant delegated (Gmail, Fastmail, Dovecot, an Exchange- compatible server), reads messages past a durable UID cursor, and — once a message's run has succeeded — marks it read or moves it aside. It registers itself as source kind "imap"; the binary blank-imports it.

Three things are load-bearing and deliberate:

  • The dial is hand-built (net.Dialer → optional TLS → imapclient.New over the conn) rather than the imapclient.Dial* helpers, for two reasons: it routes through the chassis egress Guard (net.Dialer.Control) so a source can't be pointed at loopback/private space, and it holds the net.Conn so a whole-session deadline bounds a stalled server (go-imap's Wait() takes no context).

  • MOVE is gated on the server actually advertising it (Caps().Has(MOVE)). go-imap's Move() otherwise silently falls back to COPY + \Deleted + EXPUNGE — which can lose mail if the expunge half fails — so when MOVE is absent we degrade to marking \Seen and log it, never emulate the move.

  • The credential (mailbox password) arrives via OpenParams.Cred, is used once at LOGIN, and is never stored on the conn. The caller zeroes it the instant Open returns.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL