Method PrepareSentCopyAsync
- Namespace
- MailFathom.Application.Mail.Delivery.Filing
- Assembly
- MailFathom.Application.dll
PrepareSentCopyAsync(OutgoingEmailRecord, CancellationToken)
Prepares the sent copy of a delivered message, where its account is held and files one.
[SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "The delivery this copy belongs to has already reached its recipients, and recording it must not wait on a copy; every failure is recorded against the send's filing instead.")]
public Task<LocalMailCopy?> PrepareSentCopyAsync(OutgoingEmailRecord record, CancellationToken cancellationToken)
Parameters
recordOutgoingEmailRecordThe send that was accepted.
cancellationTokenCancellationTokenStops the preparation when the host is shutting down; a cancelled preparation is recorded as a filing failure like any other.
Returns
- Task<LocalMailCopy>
The prepared copy, or null where none is to be filed or none could be prepared.
Remarks
Nothing escapes it, because it runs between a submission server accepting the message and the record saying so, and a failure that stopped that write would leave a delivered message looking undelivered. A copy that could not be prepared is recorded as the filing failure it is and the delivery commits without it.
Exceptions
- ArgumentNullException
Thrown when
recordis null.