Class MailDraftPromotion
- Namespace
- MailFathom.Application.Mail.Delivery.Drafts
- Assembly
- MailFathom.Application.dll
Turns one draft into an ordinary send, carrying the bytes the draft already is.
public sealed class MailDraftPromotion
- Inheritance
-
MailDraftPromotion
- Inherited Members
Remarks
A promoted draft is not a second kind of send. What comes out is the outgoing record every other send is written
down as, transmitted through the same outbox and filed by the same mechanism, and what goes in is the stored MIME
the drafts folder already shows — so the message the owner read in their own mail client is byte for byte the
message their correspondent receives. Nothing is recomposed, which is what keeps the Message-ID the one the
draft has been carrying.
Every bound this deployment sets is asked again here, not only when the draft was written. A draft may have been composed months before the recipient policy was tightened, the ceilings were lowered, or sending was turned off for the account — so the answer that matters is the one that holds at the moment the message would leave. The governor is asked by the outbox, where every send passes, and the size the deployment composes is compared against the bytes actually stored rather than against what was measured when they were composed.
A promotion that fails leaves the draft exactly as it was. Nothing about the draft is written until the outgoing record exists, so a refused recipient, a full period, an account that has since been turned read-only, and a message too large all leave the owner the draft they wrote.
The draft is not deleted here either. The record is queued rather than sent, so the copy in the drafts folder stands until the message has actually been delivered, and the pass that settles the send is what gives the draft up.
Constructors
- MailDraftPromotion(IMailDraftStore, IEmailContentStore, MailOutbox, IOutgoingEmailStore, OptimisticConcurrencyRetryPolicy, OutgoingEmailBounds, AccessAuthorization)
Initializes the promotion from the draft it reads and the outbox it writes the send into.
Methods
- PromoteAsync(MailDraftId, CancellationToken)
Queues one draft for delivery, or refuses it naming what stopped it.