Class OutgoingMailFilingPass
- Namespace
- MailFathom.Application.Mail.Delivery.Filing
- Assembly
- MailFathom.Application.dll
Keeps the mailbox's copies of one account's outgoing mail in step with what the outbox is doing.
public sealed class OutgoingMailFilingPass
- Inheritance
-
OutgoingMailFilingPass
- Inherited Members
Remarks
Two moments, and they are the two an outbox pass already reaches. Before it claims anything it mirrors the sends that are waiting, so a message held until Monday is visible in the mail client the owner actually uses rather than only to somebody running a command; after a send has settled it withdraws that mirror and, where the account asked for one, files the sent copy.
The outgoing record stays the truth about what will be sent, and neither of these changes that. A copy in a folder is a view of the record: deleting it in a mail client cancels nothing, and cancelling is a command of its own. That is what makes the mirror safe to leave off by default and safe to switch on — the folder never becomes a second place the send is decided.
A deployment that has mapped no folder to the outbox role does none of this, which is every deployment that says nothing. The mapping is read from configuration and costs no query, so an account without one spends nothing per pass rather than reading its outbox to discover it has nothing to mirror.
Constructors
- OutgoingMailFilingPass(IOutgoingEmailStore, OutgoingMailFiler, IMailFolderMappingReader, IOutgoingMailFilingPolicyReader, TimeProvider, MailOutboxSettings)
Initializes the pass from the outbox it reads and the filer it acts through.
Methods
- MirrorWaitingSendsAsync(MailAccountId, CancellationToken)
Puts a copy of each waiting send into the folder the account mapped as its outbox.
- SettleFiledCopiesAsync(OutgoingEmailId, CancellationToken)
Brings the copies of one settled send up to date: the mirror goes, and the sent copy arrives.