imapsource

package
v0.2.63 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MPL-2.0 Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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