Skip to main content
Mount @bijectionhq/app-mail to receive mail at an inbound address. The address is the mount’s inbound slot (inbound-mail@1): at mail, it is mail.inbound. Unbound, it is managed SES: the hosted operator provisions SES receipt rules, S3 staging and an SQS queue, and the app polls through its own SigV4 receiver using a sealed, short-lived reader session scoped to the receiver’s queue and staging prefix. To receive through your own SES account instead, name it as the managed slot’s account in the installation’s bindings file: bind(app.mail.inbound, placement.managed({ account: placement.aws.ses({ region, queue, bucket, credential }) })) names the region of your receipt rule, the SQS queue SES notifies, the S3 bucket name from the rule’s S3 action (prefix defaults to mime/) and the secret path of the SigV4 reader session (mail.readerSession). Then deploy. The app, its receivers and your received reaction do not change. See placement. Reading a particular mailbox you already have, in Gmail, Microsoft 365 or an IMAP server, is a connector, not placement: see the Gmail, Microsoft Graph and IMAP integrations.

Install and activate

mail({ label, received }) returns the app to place at a path of your tree. received is your reaction to one admitted message, a mutation under the mail label whose args are receivedArgs.
app.ts
Call declareReceiver, then have the deployment operator plan, bind and activate the receiver through Mail’s operator routes, binding against the receiver revision the plan returns. The operator provisions the address and sets and refreshes the reader session. See the Mail package operator and installer reference. Mail submits received as a task under inbox once the message has committed, so its failure or refusal is that task’s result and never refuses the message. The reading queries allow Mail’s reader role. Your code grants it directly with ctx.grant(mail.reader, { to: subject, under: inbox, until }). The installer role admitted to that mutation declares include: [mail.reader] and issue: true, so it holds the reader’s rights and may hand them out.

Limits and delivery semantics

  • Each mount can open up to 64 receivers. The SES message ID deduplicates SQS redelivery while its message is retained. Queue acknowledgement deletes the exact SQS receipt. There is no historical replay cursor.
  • Receiver names, addresses and control state are public to the mount. Message rows, in-flight answers and Files live under the mail label you pass. Reserve label capacity for polling, staging and retained Files, and storage for staged and final copies.
  • The bounded S3 pull reads 36 KiB ranges. The raw message and up to 32 attachment Files share an 8 MiB budget. Failed verdicts or oversized or malformed messages can produce envelope-only records.
  • Your code can delete a message and retire its Files through Mail’s internal message functions. This is a local operation. Closing or retiring a receiver fences new admissions.
End-to-end SES receiving remains unverified.