Message
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.
You’re reading version 0.2.0. Go to the current version
Overview
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.
In the manual
Methods
receivesendthread
Declared by its execution profile. Read the profile
SKILL.md
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 whenin_reply_tonames the message it answers or follows. The person approves it at the gate, it's sent once underidempotency_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 setsoutreach;unless_inbound_sinceholds it back if they've written since, where the connector can read that. A provider that queues the send returns nosent_atand the time it'sscheduled_for;message.readon 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, asmail.arrivesnames it. Unless the connector's feed keeps the cursor, it reads the inbox: on fromafterfor mail posted to a webhook (a post can be lost) or read with noarrives, from the start when the feed has a gap, and on fromafterwhenever 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 thecursorit returns and what it makes of each message, and reads on from the cursor whenmoresays the inbox holds more.thread: one thread's messages, both ways, oldest first, on a connector that offersthread.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.
Published execution profile
The execution profile published with 0.2.0, shown as its exact bytes.
| Methods |
|
|---|---|
| Profile digest | sha256:fb5afdaff6349e8efe42923610fff04dddfb4d2550934e24ea02fbed040605b6 |
version: "0.2.0"
minimum_runx: 0.12.0
default_method: send
visibility: public
category: ops
connectors:
# The mail connectors a run may choose, the one list of them every skill
# that sends or reads mail through message shares.
mail:
choose: $input.mail.connector
from: [mailsim, nitrosend, google/gmail]
shared_inputs:
mail:
type: object
description: The mail connector the mailbox is reached through, and where mail arriving from it reaches the loop.
additionalProperties: false
required: [connector]
properties:
connector: {type: string, minLength: 1, maxLength: 64}
arrives:
type: object
description: "Where arriving mail reaches the loop: {feed: <name>}, one of the connector's feeds, or {webhook: <name>}, one of the loop's webhooks."
additionalProperties: false
minProperties: 1
maxProperties: 1
properties:
feed: {type: string, minLength: 1, maxLength: 100}
webhook: {type: string, minLength: 1, maxLength: 64}
methods:
send:
description: Send one exact email from a mailbox, in its thread when it answers or follows another, at its own gate, once under its key. The connector reads it back by the key. A send the provider queued comes back with no sent_at and the time it's scheduled for.
inputs:
mail: {}
to: {type: string, format: email, maxLength: 320, description: The one recipient.}
from_email: {type: string, format: email, maxLength: 320, description: The mailbox it's sent from, which replies come back to.}
from_name: {type: string, minLength: 1, maxLength: 255, pattern: "^\\S(.*\\S)?$"}
subject: {type: string, minLength: 1, maxLength: 998}
body: {type: string, minLength: 1, maxLength: 262144, description: Plain text, exactly as approved.}
in_reply_to:
type: string
maxLength: 998
pattern: "^<[^<>\\s]+>$"
description: The Message-ID of the message this one answers or follows, so it goes in that thread.
optional: true
outreach:
type: boolean
description: "A first contact, or a follow-up to someone who hasn't written."
optional: true
unless_inbound_since:
type: string
format: date-time
description: Not sent when the recipient has written since this time.
optional: true
idempotency_key: {type: string, minLength: 1, maxLength: 255, description: The send's key. The provider keeps one message per key, so a retry never sends twice.}
approval_reason: {type: string, minLength: 1, maxLength: 512, description: What the person is shown at the gate.}
result_from: [send]
examples:
- mail: {connector: mailsim}
to: priya@northwind.example
from_email: sam@acme.example
from_name: Sam at Acme
subject: Your release notes
body: Hi Priya, ...
idempotency_key: onboarding-acme:priya@northwind.example:welcome
approval_reason: Send this welcome to Priya at Northwind.
steps:
- id: send
operation: mail/message.send
idempotency_key: $input.idempotency_key
approval:
reason: $input.approval_reason
type: email
result:
required: [id, rfc_message_id, to, subject]
# sent_at is empty while a provider holds the send to go later, at
# scheduled_for; thread_id when the provider gives it at once.
optional: [sent_at, scheduled_for, thread_id]
equals:
to: $input.to
inputs:
to: $input.to
from_email: $input.from_email
from_name: $input.from_name
subject: $input.subject
body: $input.body
in_reply_to: $input.in_reply_to
outreach: $input.outreach
unless_inbound_since: $input.unless_inbound_since
receive:
description: "What arrived for a mailbox, each message once with its thread and person, and bounces, complaints and away messages as what they are. It takes what a loop was given by its feed or webhook, and reads the inbox unless the connector's feed keeps the cursor: on from `after` for mail posted to a webhook, read with no `arrives`, or whenever `after` is given, and from the start when the feed has a gap. It keeps nothing; the caller keeps the cursor it returns."
inputs:
mail: {}
batch:
type: array
description: The events of the loop's batch (runx.loop.batch), as runx gave them; only the ones from the mail connector's feed or webhook are read.
items: {type: object, additionalProperties: true}
optional: true
after:
type: string
minLength: 1
maxLength: 64
description: The cursor the last receive returned, to read the inbox on from.
optional: true
result_from: [receive]
examples:
- mail: {connector: mailsim, arrives: {webhook: inbound}}
after: "12"
steps:
- id: receive
script: {module: receive.mjs, export: receive}
inputs:
mail: $input.mail
batch: $input.batch
after: $input.after
# It may call only the inbox's read, so it never sends; a process
# connector's read (mailsim's) is one runx can't prove has no effect,
# so the step allows effects rather than refusing it.
calls:
operations: [mail/inbox.read]
# Twenty pages of a hundred, then `more` says to read on.
max_calls: 40
effects: allow
outputs:
messages:
type: array
items:
type: object
additionalProperties: false
required: [id, kind, thread_id, rfc_message_id, from, subject, body, received_at]
properties:
id: {type: string}
kind: {enum: [reply, auto_reply, bounce, complaint]}
thread_id: {type: [string, "null"]}
rfc_message_id: {type: [string, "null"]}
from: {type: string, description: "The person: who wrote, or who a bounce or complaint is about."}
subject: {type: [string, "null"]}
body: {type: [string, "null"], description: The message as plain, untrusted text.}
received_at: {type: string, format: date-time}
unreadable: {type: integer, minimum: 0, description: Envelopes that couldn't be read as mail.}
gap: {type: boolean, description: The feed couldn't replay from its cursor, so the inbox was read from the start.}
cursor: {type: [string, "null"], description: Where the inbox was read to, to give as after next time.}
more: {type: boolean, description: The inbox holds more past cursor than this read took.}
thread:
description: One thread's messages, both ways, oldest first.
inputs:
mail: {}
thread_id: {type: string, minLength: 1, maxLength: 255}
result_from: [read]
examples:
- mail: {connector: mailsim}
thread_id: thr_0123456789abcdef
steps:
- id: read
operation: mail/thread.read
inputs:
thread_id: $input.thread_id
Published package and test evidence.
This exact version passed its recorded test run: 9 checks passed · 0 failed.
Test result
| Test result | Passed |
|---|---|
| Tested version | 0.2.0 |
| Recorded result | 9 checks passed · 0 failed |
| Result source | Reported by the publisher (runx_registry_publish) |
| Suite | runx-test |
| Test recorded | |
| Declared cases | 9 |
| Test record | Open the recorded run |
Inspect receipt references
sha256:3b121129e4bb1316a77256af8e51aed92bdef947754f9ba6e4f05dc1dae04925sha256:729adb1596b5dc1ab512f60a201a16a49aa80cf7595cd13b66f83ccd838126dbsha256:3eb6f6745b4f151d26bfd02f03291a4533270bb9d0e934881260bf26c024d298sha256:f898a309138180967907b8245cacfd113f6daf065c8701f97ab0a3505f90b53bsha256:8d703a5a7f870e0f9a6d35fb70741392bc5b3553fcada886a752bf5d2f13b3d9sha256:a14297f4d549da2b8f8de6ee13e1531474a21f2ea1c114209af43fd36cbc32a7sha256:5b4f85d8af12d9cc202cc485ddd20e65b90302d29d95738ce6957e6564cd2af9sha256:4834d298e96ecf298d066e3d1a0f855ed3e0a1c5c0290597081d84c44bd438fasha256:1b83d4c302a4816c8086eb47ee2de2375feada1f12335e13757768eab68168e1Package identity
| Published revision | 0.2.0 |
|---|---|
| Content digest | sha256:b9a5c4ef7e66ec25091a4c14a7c5e490d7c5cd3ace6e2e333a041f224cb31575 |
| SKILL.md digest | sha256:ca6de1f0232ec1136c8ff9dab128686ea21819dfdd0e288cd7a388b3fdd06361 |
| Execution profile digest | sha256:fb5afdaff6349e8efe42923610fff04dddfb4d2550934e24ea02fbed040605b6 |
| Publisher identity | Verified publisher · runx |
| Trust tier | Verified publisherrunx has verified this publisher. This tier is not a code assessment. |
| Attestations |
|
| Source provenance | Not published with this version |
Version history
0.2.0ViewingContent digest sha256:b9a5c4ef7e66ec25091a4c14a7c5e490d7c5cd3ace6e2e333a041f224cb31575