Skip to content

# Config

## `` mail_intake.config

### Summary

Global configuration models for Mail Intake.

This module defines the top-level configuration object used to control mail ingestion behavior across adapters, authentication providers, and ingestion workflows.

Configuration is intentionally explicit, immutable, and free of implicit environment reads to ensure predictability and testability.

### Classes

#### `` MailIntakeConfig `dataclass`

    1

    MailIntakeConfig(provider: str = ..., user_id: str = ..., readonly: bool = ..., credentials_path: Optional[str] = ..., token_path: Optional[str] = ...)

Global configuration for `mail-intake`.

Notes

Guarantees:

    1
    2
    3
    4
    5
    6

    - This configuration is intentionally explicit and immutable.
    - No implicit environment reads or global state.
    - Explicit configuration over implicit defaults.
    - No direct environment or filesystem access.
    - This model is safe to pass across layers and suitable for
      serialization.

##### Attributes

###### `` credentials_path `class-attribute` `instance-attribute`

    1

    credentials_path: Optional[str] = None

Optional path to provider credentials configuration.

###### `` provider `class-attribute` `instance-attribute`

    1

    provider: str = 'gmail'

Identifier of the mail provider to use (e.g., `"gmail"`).

###### `` readonly `class-attribute` `instance-attribute`

    1

    readonly: bool = True

Whether ingestion should operate in read-only mode.

###### `` token_path `class-attribute` `instance-attribute`

    1

    token_path: Optional[str] = None

Optional path to persisted authentication tokens.

###### `` user_id `class-attribute` `instance-attribute`

    1

    user_id: str = 'me'

Provider-specific user identifier. Defaults to the authenticated user.