Enum MailboxMutationStage
- Namespace
- MailFathom.Domain.Mutations
- Assembly
- MailFathom.Domain.dll
States how far along its protocol sequence one recorded mutation has durably reached.
public enum MailboxMutationStage
Fields
Abandoned = 5The mutation will not be attempted again, and the failure that ended it is on the record.
A refused mutation and one that spent its bounded attempts both end here, which is what keeps a failing change visible instead of pending forever.
Completed = 4The mutation is done, and asking for it again performs nothing.
PlacementConfirmed = 2The server acknowledged the placement, and named it where it supplied a
COPYUIDresponse.A copy is finished at this stage. A relocation carried by the fallback sequence is not: its source is still in the folder, and removing it is what remains.
PlacementIssued = 1The command that would place the email in its destination folder has gone out, and its answer has not been read.
This is the one stage a retry may not act on.
UID COPYissued twice is a second message rather than a repeat of the first, and nothing in the destination folder afterwards says whether the first attempt landed, so a mutation found here is reported as an unknown outcome and left for a person or for convergence to resolve.Recorded = 0The intent is durable and no IMAP command has been issued for it.
Every mutation starts here, and a retry from here is safe because nothing has reached the server.
SourceFlaggedDeleted = 3The source email carries
\Deletedand the message-scoped expunge has not been acknowledged.Both commands are idempotent for one UID, so a retry from here reissues the expunge alone and a repeat costs nothing.
Remarks
The members are the stages the IMAP sequences actually have rather than a generic pending, running, and done. That is what makes the value usable for resumption: a retry reads the stage and continues from it, and the one command that must never be issued twice is recognized by the stage that precedes it rather than by inspecting the mailbox afterwards, which cannot tell a copy MailFathom made from one a person made.
No mutation passes through every stage. A SetSeen goes straight from Recorded to Completed, because a flag write is idempotent on the wire and its record exists for provenance rather than for retry safety. A Delete passes through SourceFlaggedDeleted and never through the placement stages, because it puts the email nowhere. A Copy passes through the placement stages and never through SourceFlaggedDeleted, because it leaves the source alone. Only a Relocate carried by the fallback sequence reaches all four.
The stage is stored as its name so it stays readable in an ad-hoc audit query and survives any later reordering of this enum, which is the same reason the stored content availability and the content defect are stored that way.