Class MailDraftRecord
- Namespace
- MailFathom.Domain.Delivery.Drafts
- Assembly
- MailFathom.Domain.dll
Reports one message this deployment holds that has not been sent and may never be.
public sealed record MailDraftRecord : IEquatable<MailDraftRecord>
- Inheritance
-
MailDraftRecord
- Implements
- Inherited Members
Remarks
A draft is its own record rather than a stage of OutgoingEmailRecord, because almost nothing an outgoing record exists for is true of one. It has no delivery, no recipient that has to be valid, no idempotency identity against a duplicate that could not be withdrawn, and no terminal stage — a draft is edited for as long as its owner keeps editing it. What it has instead is the one thing an outgoing record never does: a copy on somebody else's server that has to be replaced whenever the local one changes.
That replacement is the whole difficulty. IMAP has no command that changes a stored message, so a revision is an
APPEND of the new version followed by a removal of the old one, and a process can die between them. The
revision is therefore written down before the first command, and Stage is what a resumed attempt
reads to finish the pair instead of starting it again.
It is derived personal data on the same terms as the mail beside it: a draft says who this mailbox's owner is writing to and what about. The addresses are here because a promotion cannot build an envelope without them, the message itself stays in the content store, and the record is erased with the mail it belongs to.
Properties
- AccountId
Gets the account the draft belongs to, and the one a promotion would send it as.
- Author
Gets the authored act that wrote the draft down.
- AwaitsPromotionGiveUp
Gets whether a promotion of this draft has yet to give the draft up.
- ComposedAt
Gets when the draft was first written down.
- Copies
Gets every copy of this draft MailFathom has appended, newest revision first.
- CurrentCopy
Gets the copy carrying the revision the stored message is.
- DiscardedAt
Gets when the draft was given up, or null while it stands.
- Divergence
Gets why the tracked copy stopped being one MailFathom may touch, or null while none has.
- HasOutstandingServerWork
Gets whether an attempt against the mail server would do anything for this draft.
- HasUnansweredAppend
Gets whether an append of this draft went out and the server's answer to it never came back.
- Id
Gets what everything after the first write refers to this draft by, including its stored MIME.
- IsAddressed
Gets whether this draft names anybody to send it to.
- IsDiscarded
Gets whether the draft has been given up and is being taken out of the mailbox.
- LastFailure
Gets the failure the last attempt on the mailbox ended in, or null while none has failed.
- MimeByteLength
Gets how many bytes of MIME are stored for the current revision.
- PromotedTo
Gets the outgoing record a promotion wrote, or null while the draft was never promoted.
- Recipients
Gets the people the draft is addressed to, which may be nobody.
- RevisedAt
Gets when the draft last changed, which is what an owner sorts their drafts by.
- Revision
Gets which revision of the draft the stored message is, counted from one and increased by every edit.
- Stage
Gets what the draft owes the mail server.
- SupersededCopies
Gets every copy a revision replaced that the folder still holds.
Methods
- FindCopy(int)
Finds the copy carrying one revision of this draft.