Method StoreFiledEmailAsync
- Namespace
- MailFathom.Application.Synchronization
- Assembly
- MailFathom.Application.dll
StoreFiledEmailAsync(IPersistenceSession, MailAccountId, MailFolderResolutionId, ExtractedEmailMetadata?, long, AppendedMailFlags, OutgoingEmailId?, CancellationToken)
Stores a message MailFathom filed itself into a held account's local folder, with no occurrence on any server.
Task<StoredEmailId?> StoreFiledEmailAsync(IPersistenceSession session, MailAccountId account, MailFolderResolutionId binding, ExtractedEmailMetadata? extractedMetadata, long sizeOctets, AppendedMailFlags flags, OutgoingEmailId? filedFrom, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe explicit persistence session this write participates in.
accountMailAccountIdThe account the message is filed for.
bindingMailFolderResolutionIdThe folder binding of the source folder playing the role the message is filed under.
extractedMetadataExtractedEmailMetadataWhat was read out of the message's MIME, or null when nothing could be.
sizeOctetslongHow large the message is.
flagsAppendedMailFlagsThe flags the message is filed with.
filedFromOutgoingEmailId?The outgoing record a sent copy is filed from, or null for a draft.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task<StoredEmailId?>
The new stored email's identity, or null where
bindingnames a folder binding that is no longer stored.
Remarks
A binding that is gone is answered rather than raised, because it was read before the transaction and the drain removes exactly those source folders: the caller files nothing and says so, and the state the message was a copy of still commits.
The row is written as a synchronized one is — the search document and the conversation are placed in the same session — so a draft or a sent message is found and threaded exactly as the copy a server would have returned.
A stored message still names a folder binding, and a filed one names the binding of the source folder playing its role: that is where the source keeps the same kind of message, and what a provider's own copy of a sent message is later drained from.