# `MailglassInbound.InboundMessage`
[🔗](https://github.com/szTheory/mailglass/blob/v0.1.0/lib/mailglass_inbound/inbound_message.ex#L1)

Canonical normalized inbound message passed to routing and mailbox code.

`MailglassInbound.InboundMessage` is the stable adopter-facing contract for
the first inbound package slice. It models the normalized fields Mailglass
can promise across first-party ingress providers while keeping raw payloads,
signature evidence, replay metadata, and mailbox execution state out of the
public struct.

## Stable Fields

- `:tenant_id` - explicit tenant scope for routing and execution.
- `:provider` - first-party ingress provider name.
- `:provider_message_id` - provider-specific message reference when present.
- `:message_id` - RFC `Message-ID` header value when present.
- `:envelope_recipient` - SMTP/envelope recipient used for routing.
- `:from`, `:to`, `:cc`, `:bcc`, `:reply_to` - normalized address data.
- `:subject` - normalized message subject.
- `:headers` - normalized header map for routing and mailbox reads.
- `:sent_at`, `:received_at` - normalized timestamps.
- `:text_body`, `:html_body` - normalized body fields.
- `:attachments` - normalized attachment manifest without attachment bytes.

# `address`

```elixir
@type address() :: %{:address =&gt; String.t(), optional(:name) =&gt; String.t() | nil}
```

# `attachment`

```elixir
@type attachment() :: %{
  optional(:filename) =&gt; String.t() | nil,
  optional(:content_type) =&gt; String.t() | nil,
  optional(:disposition) =&gt; :attachment | :inline | String.t() | nil,
  optional(:content_id) =&gt; String.t() | nil
}
```

# `provider`

```elixir
@type provider() :: :postmark | :sendgrid | String.t()
```

# `t`

```elixir
@type t() :: %MailglassInbound.InboundMessage{
  attachments: [attachment()],
  bcc: [address()],
  cc: [address()],
  envelope_recipient: String.t() | nil,
  from: [address()],
  headers: %{optional(String.t()) =&gt; [String.t()]},
  html_body: String.t() | nil,
  message_id: String.t() | nil,
  provider: provider() | nil,
  provider_message_id: String.t() | nil,
  received_at: DateTime.t() | nil,
  reply_to: [address()],
  sent_at: DateTime.t() | nil,
  subject: String.t() | nil,
  tenant_id: String.t() | nil,
  text_body: String.t() | nil,
  to: [address()]
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
