Ingestion
mail_intake.ingestion
Mail ingestion orchestration for Mail Intake.
Summary
This package contains high-level ingestion components responsible for coordinating mail retrieval, parsing, normalization, and model construction.
It represents the top of the ingestion pipeline and is intended to be the primary interaction surface for library consumers.
Components in this package: - Are provider-agnostic - Depend only on adapter and parser contracts - Contain no provider-specific API logic - Expose read-only ingestion workflows
Consumers are expected to construct a mail adapter and pass it to the ingestion layer to begin processing messages and threads.
Public API
1 | |
Classes
MailIntakeReader
High-level read-only ingestion interface.
Notes
Responsibilities:
1 2 | |
Constraints:
1 | |
Initialize the mail reader.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
adapter |
MailIntakeAdapter
|
Mail adapter implementation used to retrieve raw messages and threads from a mail provider. |
required |
Functions
iter_messages
Iterate over parsed messages matching a provider query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query |
str
|
Provider-specific query string used to filter messages. |
required |
Yields:
| Name | Type | Description |
|---|---|---|
MailIntakeMessage |
MailIntakeMessage
|
Fully parsed and normalized |
Raises:
| Type | Description |
|---|---|
MailIntakeParsingError
|
If a message cannot be parsed. |
iter_threads
Iterate over threads constructed from messages matching a query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query |
str
|
Provider-specific query string used to filter messages. |
required |
Yields:
| Name | Type | Description |
|---|---|---|
MailIntakeThread |
MailIntakeThread
|
An iterator of |
Raises:
| Type | Description |
|---|---|
MailIntakeParsingError
|
If a message cannot be parsed. |
Notes
Guarantees:
1 | |