---
name: message
description: Send one exact email from a mailbox and read what comes back to it, through whichever mail connector the run chooses, gated, sent once under its key and read back; replies, bounces, complaints and away messages come back as messages with their thread and person.
---

# Message

One mailbox, sending and receiving, the same way through every mail
connector: mailsim for rehearsal, Nitrosend, Gmail (`google/gmail`, through
the person's connection: runx's Google app sends only, so reading needs their
own Google app, and with no feed a loop reads its inbox on from its cursor),
and any other that offers the mail slot's operations (`message.send`, `message.read`, `inbox.read`,
`thread.read`). The run chooses the connector with `mail.connector`. A skill
that sends or reads mail composes this one, so the mail connectors are listed
once, here.

The mailbox that sends is the one replies come back to, so a send takes no
Reply-To.

## Methods

- `send` (default): one exact email to one person, in its thread when
  `in_reply_to` names the message it answers or follows. The person approves
  it at the gate, it's sent once under `idempotency_key`, and a connector that
  can read reads it back by the key; Gmail answers with what it acknowledged.
  A first contact or a follow-up to someone who hasn't written sets
  `outreach`; `unless_inbound_since` holds it back if they've written since,
  where the connector can read that. A provider that queues the send returns no `sent_at`
  and the time it's `scheduled_for`; `message.read` on the connector says
  when it went.
- `receive`: what arrived, each message once by its id, with its kind
  (`reply`, `auto_reply`, `bounce`, `complaint`), thread, person, subject and
  plain-text body. It reads the envelopes a loop's batch carries from the
  connector's feed or the loop's webhook, as `mail.arrives` names it. Unless
  the connector's feed keeps the cursor, it reads the inbox: on from `after`
  for mail posted to a webhook (a post can be lost) or read with no `arrives`,
  from the start when the feed has a gap, and on from `after` whenever one is
  given, as a caller finishing a catch-up gives it.
  A soft bounce is left to the provider, which retries it. Envelopes it can't
  read are counted, never dropped silently. It writes nothing: the caller
  keeps the `cursor` it returns and what it makes of each message, and reads
  on from the cursor when `more` says the inbox holds more.
- `thread`: one thread's messages, both ways, oldest first, on a connector
  that offers `thread.read`.

## What it doesn't do

It never decides who may be written to, drafts a message or keeps a record.
Those are the caller's: a loop's skill keeps its people and threads, ghostwrite
writes, and the connector's own reads (`eligibility.read`,
`suppression.read`) answer who may be written to. A Slack post or reply is
the slack skill's.
