Add a POP3 import source #82

Merged
jcoffey-dev merged 1 commits from feat/pop3-source into main 2026-11-13 19:26:58 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev eeae381c18 Add a POP3 import source
ci / test (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 5m51s
ci / announce (pull_request) Skipped
import pop3 reads a POP3 mailbox into an archive: the whole maildrop
into one INBOX (POP3 has no folders and no flags), keyed by each
message's UIDL so a later run adds only what arrived since. pop3s:// is
TLS from the first byte; pop3:// upgrades with STLS before the password
is sent, or sends cleartext with --allow-cleartext. The TLS transport is
the IMAP client's, reused.

Two things set it apart from the other sources. It is additive: a
message in the archive but gone from the server is kept, since POP3
mailboxes are routinely emptied after download and a message leaving the
server says nothing about whether the archive should still hold it. And
it never changes the source -- no DELE -- so a run only reads and is safe
to repeat.

--estimate reports counts and sizes from STAT/UIDL/LIST before any body
is fetched. Messages are keyed in a new sync_id_pop3 table; the sources
kind CHECK gains 'pop3', and an older archive's table is rebuilt to
accept it, as it already was for earlier kinds.
2026-11-13 12:16:04 -07:00