Skip to content

Inbox and Outbox

In the ActivityPub Server-to-Server (S2S) protocol, the exchange of messages is managed through two primary endpoints: Inbox and Outbox.

In a pure S2S context, the Outbox serves as the formal origin or the “sent folder” for an actor’s activities. When a server generates a new activity (such as a Create or Announce), it is conceptually added to the actor’s Outbox to represent the actor’s history of outgoing actions.

Once an activity is generated, the server initiates the delivery process to notify relevant peers:

  1. Identifying Targets: The server examines the to, cc, and audience fields, as well as the actor’s followers list, to determine the inbox URLs of the remote recipients.
  2. Dispatching: The server then performs an HTTP POST of the activity to each identified remote inbox.

the Inbox is the designated endpoint for receiving activities sent by external servers.

  1. Activity Reception: An external server POSTs an Activity to the actor’s inbox URL.
  2. Verification and Processing: The receiving server verifies the request’s authenticity (e.g., via HTTP Signatures). If valid, the activity is processed—such as being stored in the database or triggering a notification for the local user.

When an actor has a large following (thousands or millions of followers), POSTing to every individual follower’s inbox creates immense overhead. The Shared Inbox optimizes this high-volume delivery.

  • Mechanism: If multiple followers reside on the same remote instance, the sending server POSTs the activity only once to a sharedInbox endpoint defined by that instance.
  • Internal Distribution: The receiving server accepts the single POST and internally distributes the activity to all relevant local users.

This mechanism significantly reduces network traffic and minimizes CPU/memory usage for both the sending and receiving servers.