Class ComposedMailDraft
- Namespace
- MailFathom.Application.Mail.Delivery.Composition
- Assembly
- MailFathom.Application.dll
Carries one composed draft: who it is addressed to, the identity it carries, and the bytes to store.
public sealed record ComposedMailDraft : IEquatable<ComposedMailDraft>
- Inheritance
-
ComposedMailDraft
- Implements
- Inherited Members
Remarks
It is a sibling of ComposedOutgoingEmail rather than the same type, and the difference is exactly the one that separates a draft from a send: there is no request to write down. An outgoing record's request carries the idempotency identity a delivery is protected by and requires at least one recipient, and a draft has neither — so what comes back here is the recipient list itself, which a promotion turns into a request when there is one to make.
The recipients carry their provenance for the same reason. A send's request is built from a list the governance has already read; a draft's is stored and read again by whatever promotes it, so the provenance travels with the address as far as the row it is written into.
The identity is minted per revision rather than kept across them. Every revision is a different message on the
server — IMAP has no command that changes a stored one — and two messages sharing a Message-ID is what a mail
client reads as one message it has seen twice.
The subject travels beside the bytes for the reason the recipients do: the draft's own row keeps it, so a listing of what somebody is writing names each draft without loading a single message. It is what the composed message carries rather than what the author typed, so the row and the message can never disagree about it.
Constructors
- ComposedMailDraft(IReadOnlyList<MailDraftRecipient>, string, InternetMessageId, ReadOnlyMemory<byte>)
Carries one composed draft: who it is addressed to, the identity it carries, and the bytes to store.
Properties
- MessageId
The identity minted for this revision of the draft.
- RawMime
The RFC 822 bytes to store and to append, built once and never rebuilt.
- Recipients
The people the draft names, which may be nobody, each with where its address came from.
- Subject
The subject line as the composed message carries it, which is empty where the author wrote none.