Constructor AuthoredResponseSubmission
- Namespace
- MailFathom.Application.Mail.Delivery.Submission
- Assembly
- MailFathom.Application.dll
AuthoredResponseSubmission(StoredEmailResponseAuthoring, IAuthoredEmailComposer, MailOutbox, AuthoredSendGovernor, AccessAuthorization)
Takes an answer somebody wrote to a stored email and queues it, which is the whole of what asking to reply or forward does.
public AuthoredResponseSubmission(StoredEmailResponseAuthoring authoring, IAuthoredEmailComposer composer, MailOutbox outbox, AuthoredSendGovernor governor, AccessAuthorization authorization)
Parameters
authoringStoredEmailResponseAuthoringTurns the stored email and what somebody wrote into the message to compose.
composerIAuthoredEmailComposerBuilds the MIME, and decides every header this system owns rather than the author.
outboxMailOutboxWrites the record and the message down together, and says the account has something to send.
governorAuthoredSendGovernorAnswers what this caller may be talked into sending, and records the send once it is durable.
authorizationAccessAuthorizationAnswers whether the caller that reached this holds the grant that lets it send.
Remarks
It is the counterpart of AuthoredMailSubmission for the two sends that begin from mail this deployment already holds, and it composes the same three steps in the same order: the answer is authored from the stored copy, the authored message becomes MIME, and the MIME and the request become a durable record. What replaces the resolution of an account and a recipient list is the authoring itself, because a reply is addressed by the message it answers rather than by whoever asked for it.
Nothing here transmits, and nothing here composes. The threading identifiers, the quoted original, the carried attachments, and the subject prefix are StoredEmailResponseAuthoring's, and this use case neither reads them nor could: what it receives back is an ordinary authored message, indistinguishable at this point from one that answers nothing. That is what keeps a reply and a forward bounded by the same numbers and composed by the same code as every other send.
Two grants are asked for, and they are asked for in this order. Sending is refused first, because a caller that may not send has no business reaching a use case that reads the mail it would have quoted; reading is refused by the authoring beneath, because an answer quotes the message it answers and a forward carries that message's files, so anything that reached here without it would read mail by asking to reply to it.
The message is composed against BeforeAnyServerHasSpoken for the reason a new message is: the server that will carry it is not being talked to and must not be, and what that server does decide is asked again by the delivery pass against the length that was stored.