Interface IInboundMailContentStore
- Namespace
- Tharga.Team
- Assembly
- Tharga.Team.dll
Keeps the raw content of received mail where the host wants it — blob storage, a file share — so nothing large reaches the toolkit's own store.
public interface IInboundMailContentStore
Remarks
Keyed by the mail's id, and written before the mail is recorded. The same message read twice — by two instances, or again after a crash — gets the same id, so saving twice writes the same thing twice and is harmless. SaveAsync(string, byte[], CancellationToken) must therefore overwrite, never fail on an id it already holds.
Called only by the toolkit. A caller reads content through the mailbox or postmaster service, where access is checked; this port checks nothing.
Methods
DeleteAsync(string, CancellationToken)
Removes the raw message; nothing happens when none is kept.
Task DeleteAsync(string mailId, CancellationToken cancellationToken = default)
Parameters
mailIdstringcancellationTokenCancellationToken
Returns
GetAsync(string, CancellationToken)
The raw message, or null when none is kept under this id.
Task<byte[]> GetAsync(string mailId, CancellationToken cancellationToken = default)
Parameters
mailIdstringcancellationTokenCancellationToken
Returns
SaveAsync(string, byte[], CancellationToken)
Keeps the raw message under the mail's id, replacing whatever was kept under it before.
Task SaveAsync(string mailId, byte[] raw, CancellationToken cancellationToken = default)
Parameters
mailIdstringrawbyte[]cancellationTokenCancellationToken