# `Letterbox.Inbound`
[🔗](https://github.com/hattoriai/letterbox/blob/v0.1.0-rc.0/lib/letterbox/inbound.ex#L1)

A message that came in: one row each, in `letterbox_inbound`, with the
raw email kept in the app's store (`:raw_key`).

Its `:status` says where it is:

  * `"pending"` - its provider told of it (a webhook); Letterbox is
    fetching it.
  * `"received"` - kept, waiting for its mailbox.
  * `"processing"` - its mailbox has it.
  * `"delivered"` - its mailbox took it (`:ok`).
  * `"bounced"` - its mailbox refused it (`{:bounce, reason}`), or it
    was too large to keep: `:error` says why.
  * `"unrouted"` - no route took any of its recipients.
  * `"failed"` - its mailbox failed `:max_attempts` times, or its
    provider never gave it: `:error` has the last failure.

A failed or bounced message can be processed again (`Letterbox.retry/1`).

# `t`

```elixir
@type t() :: %Letterbox.Inbound{
  __meta__: term(),
  attempts: term(),
  channel: term(),
  checksum: term(),
  error: term(),
  external_id: term(),
  from: term(),
  id: term(),
  ingress: term(),
  inserted_at: term(),
  mailbox: term(),
  message_id: term(),
  meta: term(),
  processed_at: term(),
  raw_bytes: term(),
  raw_key: term(),
  recipients: term(),
  status: term(),
  subject: term(),
  updated_at: term()
}
```

---

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