Class MailContactCollector
- Namespace
- MailFathom.Application.Contacts.Collection
- Assembly
- MailFathom.Application.dll
Records the people an account corresponds with, out of the mail synchronization has just committed.
public sealed class MailContactCollector
- Inheritance
-
MailContactCollector
- Inherited Members
Remarks
This runs inside the pass that stored the message and owns no worker, timer, or queue: the headers are already read and the transaction has already committed, so what is left is a bounded number of indexed reads and, rarely, one insert. It reaches the mail server for nothing at all, which is what keeps it out of the fetch it runs behind.
Which addresses are considered is decided by the folder the message arrived in. A message in an ordinary
folder is somebody writing to the owner, so its author — the From header — is the candidate. A message in the
folder mapped as Sent is the owner writing to somebody, so its primary
recipients — the To header — are. Drafts are unsent and say nothing about correspondence; junk and trash say
the opposite of what a book is for. No other header is ever read: Cc and Bcc are the copied recipients
of somebody else's thread, and Sender and Reply-To name where a message was submitted from and where a
reply is to go rather than who the correspondent is.
The two directions are held to different evidence, deliberately. An address that wrote to the owner is recorded once it has written MinimumMessagesFromSender times, because one message from a stranger is not correspondence. An address the owner wrote to is recorded at once, because the owner having addressed somebody is exactly the evidence a count of their messages is standing in for.
An address the book already holds is left alone — under either origin and without collection ever reading the record. That is the collision rule the issue behind this feature asked for, and it is a refusal rather than a merge: an address that turns out to belong to somebody the owner asserted is already answered for by that record, and adding it there would be collection editing what an owner wrote down. An owner who wants the address on that person puts it there themselves, which is one amendment rather than a rule guessing on their behalf.
Nothing here logs, and nothing it hands to an instrument names a person. What it reports is which of six conclusions it reached, and the identities involved stay between the message and the book.
Constructors
- MailContactCollector(ContactBook, IContactCollectionSettingsReader, IAuthoredMailTally, IContactCollectionTelemetry)
Initializes collection over the book it writes to and the evidence it reads.
Fields
- MaximumRecipientsCollected
How many primary recipients a message the owner sent may name and still be read as correspondence.
Methods
- CollectFromAsync(ExtractedEmailMetadata, ContactCollectionRun, CancellationToken)
Records whoever one committed message says the account corresponds with.
- OpenRun(MailAccountId, MailFolderSpecialUse?)
Opens what one synchronization run of one folder collects under.