Table of Contents

Class ClassifyStoredEmailSpamJobPayload

Namespace
MailFathom.Application.Jobs.Payloads
Assembly
MailFathom.Application.dll

Points one job at a single stored email, and at nothing inside the message.

public sealed record ClassifyStoredEmailSpamJobPayload : IJobPayload, IEquatable<ClassifyStoredEmailSpamJobPayload>
Inheritance
ClassifyStoredEmailSpamJobPayload
Implements
Inherited Members

Remarks

Every property is one of MailFathom's own identifiers: the account the mailbox is, and the email's own stored identity. A handler therefore resolves what it needs from committed local state rather than from anything the enqueuer copied, and a subject, an address, a body, and extracted text are all absent by construction: there is no property to put one in.

The email is named by its stored identity rather than by where a mail server holds it, because that identity is what the email is for its whole life. A UID is renumbered by a UIDVALIDITY change and cleared once no server holds the message, and a job naming one would then find nothing to classify although the mail is still here.

The properties are primitives rather than the domain value objects they came from, because this record is the stored document: it is serialized into one jsonb column and read by an operator looking at a queue.

Properties

AccountId

Gets the account whose mailbox the email belongs to.

EmailRecordId

Gets the stored identity of the email to classify.

JobType

Gets the job type this payload is the one contract of.

Methods

For(MailAccountId, StoredEmailId)

Describes one stored email as the document a job carries.

ToAccountId()

Rebuilds the generated account identifier this payload names.

ToStoredEmailId()

Rebuilds the stored identity this payload names.