Delivery, mailboxes, and push
Exact destination delivery, durable pull, acknowledgment, backlog behavior, and best-effort notification profiles.
The OpenE2EE Signal Protocol Relay owns one durable mailbox for each device and mailbox generation. A send is durable only after the destination mailbox stores the encrypted envelope or shared-body reference. Pull and acknowledgment remove stored work through the same device authority.
For a durable direct send (user-visible or background-sync), 202 means stored. Relay answers HTTP 202 only after the destination mailbox commits the encrypted envelope. An ephemeral send stores no ciphertext, and Relay answers 202 only after the online recipient device accepts it.
Delivery units
One delivery unit is one stored encrypted envelope or shared-body reference for one destination device. Each stored Relay delivery receipt is also one delivery unit.
An exact retry with the same stable operation identifier gets the stored answer. It uses no new unit while Relay keeps its retry identity. Relay keeps it while the destination mailbox holds the message. After removal by acknowledgment or expiry, Relay keeps the retry identity of the last 256 messages removed from that mailbox. A later retry is a new delivery and uses a new unit, and the recipient session refuses the replayed ciphertext.
A direct message to one account with two destination devices uses two delivery units. A group send uses approximately one unit for each destination device that stores its shared-body reference. The direct encrypted-envelope limit is 256 KiB.
Mailbox behavior
Each device mailbox has a 3,000-message working ceiling. At the maximum envelope size, that ceiling is 786,432,000 bytes. This is 78.6432% of the Free plan's storage allowance before other ciphertext.
Relay never silently evicts a live message to make space. A full mailbox still permits pull, acknowledgment, expiry, deletion, and revocation. A new direct send receives a typed MAILBOX_FULL refusal, nothing is stored, and the send is not charged.
Relay delivery receipts and E2EE receipts
Two receipts can tell a sender that a message arrived. They mean different things.
- A Relay delivery receipt is the Relay's record that the recipient device stored and acknowledged a message. It never proves decryption. It sets the delivery status to
deliveredwithsource: 'signal-relay'. - An E2EE receipt is the end-to-end encrypted receipt that a recipient device sends. It sets the delivery status to
deliveredwithsource: 'e2ee'anddecryptionConfirmed.
The delivery status only moves forward, and it keeps every source that reported it.
Project policy
relayReceipts is a policy of each project environment, and it is on by default. Change it on the Delivery page of the project in the Console. When it is on, Relay makes a Relay delivery receipt when the recipient device acknowledges a message. Relay makes none for sealed-sender, self, background-sync, ephemeral, or expired messages.
When relayReceipts is off, Relay makes no Relay delivery receipt. The receipted list is empty, and the SDK sends its own E2EE receipt under the 'auto' rules. A message that a send stored before the change still makes a receipt when the recipient device acknowledges it. The SDK option deliveryReceipts is a separate setting.
Wire frames
Relay stores one receipt for each sender account and acknowledgment batch, at each active device of the sender. A delivery-receipt frame carries at most 32 receipts. Each receiptId has 43 characters.
{"type":"delivery-receipt","receipts":[{"receiptId":"Zm9v…","recipient":{"accountId":"acc_b","deviceId":2},"messageIds":["m1","m2"],"deliveredAt":1791300000000}]}The sender device removes receipts with acknowledge-receipts. One frame takes 1 to 100 IDs, and Relay sends no reply. A frame with more than 100 IDs closes the socket with code 1008.
{"type":"acknowledge-receipts","receiptIds":["Zm9v…"]}Relay answers the recipient device's acknowledgment with an acknowledged frame. Its receipted list holds the message IDs for which Relay started a receipt.
{"type":"acknowledged","messageIds":["m1","m2"],"receipted":["m1"]}Over HTTP, /mailbox/pull returns receipts next to messages. The pull request takes an optional limit from 1 through 100 messages. The default limit is 100 messages.
/mailbox/acknowledge takes an optional receiptIds list and returns receipted and receiptsAcknowledged. The mailbox-capabilities frame and the pull field relayReceipts: true state protocol support only, not the project policy.
Retention and limits
A Relay delivery receipt has the same retention as its message, and never more than 30 days. Delivery is best effort. Relay makes one attempt to store each receipt and never retries it. When the sender mailbox is full, Relay drops the receipt. A receipt never makes a send fail with MAILBOX_FULL. Each device mailbox keeps at most 3,000 receipts and removes the oldest one past that limit.
Billing
Each stored Relay delivery receipt is one delivery unit for each sender device that stores it. A dropped receipt uses no unit. A message is one unit for each recipient device.
Receipt units depend on acknowledgment batches and active sender devices. They do not always double the message units. Turn relayReceipts off to stop these Relay receipt units.
An E2EE receipt is an encrypted envelope, so it uses delivery units as a message does. The Console delivery estimate takes a separate total for stored Relay receipt deliveries. Include E2EE receipt envelopes in its message count.
Pull pages and acknowledgment
/mailbox/pull returns one page of messages and Relay receipts. The response also carries failedEntries, a list of retained entries that Relay read and could not serve. Each entry has a messageId and a reason of body-missing or body-integrity. Relay never acknowledges or charges a failed entry. The SDK never acknowledges a failed entry either. The SDK refuses a page whose failedEntries value is not a list of entries.
A page can carry an opaque nextCursor. A pull that sends it as cursor starts after the last message of that page. A pull without a cursor starts from the mailbox head, the oldest retained message.
The SDK clears its cursor when a pull starts. It keeps the nextCursor of the page only when the page holds a message or a failed entry. When the page has an acknowledgment, the SDK keeps the cursor only after that acknowledgment succeeds. So a failed pull, an error that stops the intake of the whole page, and a failed page acknowledgment leave the cursor clear. Then the next SDK pull starts from the mailbox head. A page with no message and no failed entry also makes the next pull start from the mailbox head. A message whose work fails does not clear the cursor. That message stays in the mailbox, and a later pull from the mailbox head offers it again.
The pull response also carries retainedWork. It is true when more messages or receipts remain after the page. The failedEntries and retainedWork fields are optional. The SDK reads an absent failedEntries as no failed entry. The SDK reads an absent retainedWork as unknown, never as false. When retainedWork is absent, the subscription applies only the full-page rule, as the next section states.
Subscription pull and acknowledgment
The SDK mailbox subscription acknowledges the accepted work of each pull page with HTTP /mailbox/acknowledge. It also does this while the socket is live. It sends no request for a page with no accepted message or receipt. One request carries at most 100 message IDs and 100 receipt IDs, so a larger page uses more requests. The subscription keeps at most one HTTP acknowledgment in flight. A pull waits for that response, so its page holds no work that the acknowledgment removes.
A full page holds 100 messages or at least 32 Relay receipts. A full page that makes progress pulls the next page at once. If the page has an acknowledgment, this pull waits for it. A page makes progress when Relay removed work for it, or when the SDK keeps a new nextCursor from it. A nextCursor equal to the cursor of the pull is not new. A page with retainedWork: true that makes progress also pulls the next page at once. A page whose retainedWork is false or absent uses only the full-page rule.
A lost page acknowledgment request or response schedules one pull from the mailbox head on a wait. The wait starts at 2 seconds and doubles each time a loss schedules its pull, up to 64 seconds. A page acknowledgment that sends at least one request, and whose requests all succeed, sets the wait to 2 seconds again.
Failed work is a failed entry, a message whose work fails, or a Relay receipt that the SDK cannot receive. Failed work stays in the mailbox. The subscription then schedules a pull from the mailbox head on the failed-work wait. That wait starts at 2 seconds and doubles each time failed work schedules its pull, up to 64 seconds. A head page with no failed work, or a new socket, sets it to 2 seconds again. A page that the SDK pulls with a cursor never resets it. When the failed-work wait ends, the head pull is due. When a page pulls the next page at once and Relay removed no work for it, the next pull uses the nextCursor of that page. That pull runs before a due head pull. After any other page, a due head pull runs next.
A new socket cancels a head pull whose wait has not ended, because Relay replays the retained messages on the socket. This applies to the failed-work wait and to the lost-acknowledgment wait. Then the subscription schedules a new head pull only while a message whose work failed remains. After a new socket, the subscription schedules no pull for a failed entry or a failed Relay receipt. A later pull from the mailbox head offers it again.
Each of these waits is a random time from half to one and a half of its value. A wait schedules its pull only when no other timed recovery pull starts sooner. Otherwise the waiting recovery pull stays, and the wait does not double. The retry of a failed pull and a pull that runs at once are not timed recovery pulls. When only such a pull waits, the wait still schedules its pull and doubles. A timed recovery pull sends the cursor, if the SDK has one, unless failed work or a lost page acknowledgment scheduled it.
The SDK queues at most 100 messages and Relay receipts that arrive on the socket. The two kinds share this limit. One batch from that queue takes at most 32 Relay receipts, so the queue and its batch hold at most 132 receipts. The SDK sets no maximum on the receipts of a pull page. A message or receipt past a full queue stays in the mailbox. The subscription pulls it with no wait when the queue is empty. A failed pull or a lost page acknowledgment cancels that pull. The message then waits for the next scheduled pull. Ephemeral messages use a separate queue of 100 items. An ephemeral message past a full queue ends the socket, and the subscription connects again.
Push and notification profiles
Expo, APNs, FCM, and Web Push carry best-effort wakes. Provider payloads contain
no message plaintext, ciphertext, sender or recipient identity, device or message
identifier, group or conversation identifier, attachment reference, or receipt
state. On a wake, the application runs pullHostedSignalProtocolRelayAfterWake(). One call
makes one authenticated pull of one mailbox page. It tries to store each
envelope and to receive each Relay receipt. Then it acknowledges the envelopes
and receipts that it accepted, and it processes the stored receives. The
deadlineMs option of pullHostedSignalProtocolRelayAfterWake() limits the time that this
processing takes. There is no limit by default. At the limit, the processing
stops between two stored receives. The next call processes the stored receives
that remain. An error in that processing does not clear the cursor, because the
SDK keeps the cursor after the acknowledgment.
HostedSignalProtocolRelayWakeResult.retainedWork copies the Relay report for that page.
True means that Relay keeps more work, so call
pullHostedSignalProtocolRelayAfterWake() again. False means that Relay keeps no more work
after that page. An absent field means that the retained work is unknown. Never
read an absent field as false.
Push providers can lose, delay, duplicate, or reorder a best-effort wake. Delivery correctness therefore depends on mailbox pull, not on a push provider. Relay removes an invalid provider token after the provider returns its terminal invalid-token result.
The device registers one profile that the project allows:
| Profile | iOS behavior | Special Apple approval |
|---|---|---|
background-only | Discretionary background wake | No |
visible-alert | Generic visible alert, then application pull | No |
nse-visible | Generic alert that invokes an eligible Notification Service Extension | No |
nse-filtering | The extension can modify or suppress the alert | Yes |
nse-filtering stays unavailable until Apple approves the filtering entitlement
and a signed physical-device build proves extension execution and suppression.
The entitlement does not improve APNs transport or guarantee execution. A
Notification Service Extension does not require that entitlement when it only
modifies visible content.
Configure iOS
Use the CLI after the first acknowledged encrypted message:
oe notifications setup ios --profile background-only
oe notifications setup ios --profile visible-alert
oe notifications add-nse
oe notifications verify iosExpo applications need a development or native build. Expo Go cannot receive this remote-push configuration or contain OpenE2EE's extension. Expo CNG uses a generated Apple target. Bare React Native uses the same generated, generic Swift source and an exact Xcode target handoff.
The generated extension has a timeout-safe generic fallback. It does not receive
App Group or Keychain access by default and does not decrypt a preview. Use
oe notifications verify ios --app-bundle PATH to inspect a signed build. A
Simulator build proves target generation and compilation, not physical-device
execution, locked-device behavior, or Apple-approved filtering.