Testing
Test an agent's inbox with a sandbox key: simulate received mail, follow threads and reply from any inbox, with nothing delivered.
Inboxes made with a sandbox (coss_test_…) key work end to end, with threads, webhooks and replies.
What's different:
- Every inbox can send, including one at coss.com's inbound domain (
can_send: true), which only receives in live environments. - Nothing you send is delivered. Sends and replies are ordinary
sandbox emails: they join the thread and get simulated
events, so
bounce@simulator.amazonses.comtests a bounce. - Inboxes are free. They aren't charged per day, but they do count towards your plan's limit on inboxes.
- Sends count towards the sandbox's limit of 500 recipients a day per environment.
The whole loop
Create an inbox and forward its webhooks to your handler:
coss inboxes create --username support-agent
coss listen --forward-to localhost:3000/webhooksThen give it mail, in either of two ways:
| How | Webhooks | Billed |
|---|---|---|
| Send a test email on the dashboard's Received emails page, to the inbox's address | Yes | No |
| Real mail from your own mail client, to the inbox's address | Yes | As any received email |
Either one files the message into a thread and sends inbox.message.received, with sandbox: true.
Then read the conversation and reply, from your handler or the terminal:
coss inboxes threads <inbox>
coss inboxes thread <inbox> <thread>
coss inboxes reply <inbox> <message> --text "On it."The reply joins the thread with its own status, though it never reaches your mail client. A second test email with the same subject and sender joins the thread too, as an answer would (threading).
const { : } = await ...(, );
for (const of ?. ?? []) {
.(., ., .);
}Verdicts
Put a marker in a test email's subject to try what your agent does with suspicious mail:
| Subject contains | Result |
|---|---|
[coss-test:spam] | Filed with spam: true, in the message and its webhook |
[coss-test:virus] | Blocked: it never reaches the inbox, and no inbox.message.received is sent |
[coss-test:spf-fail], [coss-test:dkim-fail] and [coss-test:dmarc-fail] set the
authentication verdicts of the received email.
Just the webhook
coss trigger sends a sample event, for working on a handler without any mail. Its ids are made up,
so pass real ones if your handler reads the thread:
coss trigger inbox.message.received -F inbox_id=<inbox> -F thread_id=<thread> -F message_id=<message>Last updated
On This Page