feat(email-ingress): optional dead-letter folder for dropped messages (LC-77-DEAD-LETTER) #208
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-77-dead-letter"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Closes #203. Adds an optional dead-letter IMAP folder that the poll loop UID-COPYs dropped messages into before marking the source
\Seen, so an operator can inspect rejected mail via any IMAP client without grepping logs.Mechanism
imap_inbox_config.dead_letter_foldercolumn. Empty = feature off (v1 always-\Seenposture; structured log is the only diagnostic).poll_once, including the two pre-process paths (FETCH failure, oversize raw payload), the helperdead_letter_uidissuesUID COPY <uid> <folder>beforemark_seen. Thereasontag passed to the COPY log line tells you which drop kind triggered it.target=email_ingress::dead_letterand the\SeenSTORE still runs. A misconfigured dead-letter folder cannot block the queue.Anti-scope
Admin surface
The IMAP settings admin form gets a new text input "Dead-letter folder (optional)" alongside the existing folder + ingress-domain rows. The upsert clears a previously-set folder when the operator empties the input (asymmetric with the password field, which preserves on empty input; an empty dead-letter input is an explicit "off" intent).
Tests
db_imap_config_dead_letter.rs(3 round-trip tests: Some/None round trip, the clear-on-empty upsert behavior).just testandjust test-saasboth green.just checkclean (fmt + clippy --deny warnings).async-imapsession and isn't unit-tested without a greenmail fixture. Manual smoke per the Test plan covers it.Docs
docs/email-ingress.mdremoves the deferred entry for the dead-letter folder and adds a Dead-letter folder (LC-77-DEAD-LETTER) section.CLAUDE.mdgets a one-paragraph note.Test plan
just testjust test-saasjust checkList-Id-tagged message), confirm a copy lands in the dead-letter folder while the source UID is marked\Seen.\Seenand an INFO log line appears undertarget=email_ingress::dead_letter.