Table of Contents

Class MailOutboxPass

Namespace
MailFathom.Application.Mail.Delivery.Outbox
Assembly
MailFathom.Application.dll

Takes one bounded pass over one account's outbox, and settles every send it claims.

public sealed class MailOutboxPass
Inheritance
MailOutboxPass
Inherited Members

Remarks

A pass names one account, because that is where failure is isolated: a provider that is unreachable stalls the mail of the mailbox it serves and no other, and one claim spanning accounts would put them behind each other.

The sends it claims are attempted one at a time. Each opens a connection to the same submission server, and a provider counting connections is one that starts refusing them, so the parallelism a pass would buy is parallelism against a single endpoint. What bounds the work instead is the batch: what the pass leaves is claimed by the next one, oldest first.

It is the same pass whether a signal or an account's own synchronization run asked for it, which is what makes the signal an accelerator rather than a second mechanism: a signal that is refused, lost, or never raised costs a send the wait until that run and nothing more.

One send's failure never ends the pass. A submission server refusing one message is usually refusing every message, so the sends behind it fail quickly beside it and the account's next run is what defers them; a message that is broken on its own must not stop the ones that are not.

That holds for a send whose attempt could not even be written down. An attempt records its own answer, so what is left to fail here is the recording itself — a database that went away while the outcome was being committed — and such a send is reported as NotRecorded rather than raised through the loop. Raising would leave every send behind it in the batch claimed until its lease expired, which is the delay this pass exists to avoid, over a failure that says nothing about them.

Constructors

MailOutboxPass(IOutgoingEmailStore, MailOutboxDelivery, OutgoingMailFilingPass, MailDraftPass, IMailTransportSecurityPolicyReader, MailOutboxSettings)

Initializes the pass from the outbox it claims out of and the attempt it runs.

Methods

RunAsync(MailAccountId, CancellationToken)

Claims one batch of the account's due sends and attempts each of them.