Mailboxes

Create and manage mailboxes so users can receive and read email using standard email clients like Thunderbird, Outlook, and Apple Mail.

Overview

Mailboxes let you offer full email hosting on your verified domains. Each mailbox gets an email address, password, and access via IMAP (port 993) or POP3 (port 995), both with SSL/TLS. PostStack uses Dovecot as the mail server, with Postfix delivering inbound mail via LMTP. Mailbox credentials are managed through the API or dashboard.

Prerequisites

  • A verified domain with inbound email enabled
  • MX record pointing to your PostStack server
  • Ports 993 and 995 open on your server firewall

Email Client Settings

Use these settings to connect any email client:

IMAP ServerYour PostStack hostname
Port993
SecuritySSL/TLS
UsernameFull email address (e.g., user@yourdomain.com)
Incoming (POP3)
POP3 ServerYour PostStack hostname
Port995
SecuritySSL/TLS
Outgoing (SMTP)
SMTP ServerYour PostStack hostname
SMTP Port465
SMTP SecuritySSL/TLS
SMTP AuthSame email and password as IMAP

Thunderbird and Outlook will auto-detect these settings via autodiscovery. Gmail users can add their mailbox via POP3 (port 995). Mailbox users can only send from their own email address.

SDK Usage

typescript
import { PostStack } from '@poststack.dev/sdk';
const client = new PostStack('sk_live_...');

// Create a mailbox
const { mailbox } = await client.mailboxes.create({
  domainId: 1,
  localPart: 'support',
  password: 'secure-password-123',
  displayName: 'Support Team',
});

// List mailboxes
const { data, meta } = await client.mailboxes.list({ page: 1, per_page: 50 });

// Change password
await client.mailboxes.changePassword(mailbox.id, 'new-password-456');

// Create an alias
const { alias } = await client.mailboxes.createAlias({
  domainId: 1,
  localPart: 'help',
  destinationMailboxId: mailbox.id,
});

// Delete a mailbox
await client.mailboxes.delete(mailbox.id);
POST
/mailboxes

Create a new mailbox on a verified domain with inbound enabled.

json
{
  "domainId": 1,
  "localPart": "support",
  "password": "secure-password-123",
  "displayName": "Support Team",
  "quotaBytes": 1073741824,
  "webhookEnabled": true
}
GET
/mailboxes

List all mailboxes for the current team with pagination.

json
{
  "data": [
    {
      "id": 1,
      "emailAddress": "support@yourdomain.com",
      "displayName": "Support Team",
      "quotaBytes": 1073741824,
      "status": "active",
      "webhookEnabled": true,
      "lastLoginAt": "2026-03-28T15:30:00.000Z",
      "createdAt": "2026-03-28T12:00:00.000Z",
      "domain": { "id": 1, "name": "yourdomain.com" }
    }
  ],
  "meta": { "page": 1, "perPage": 50, "total": 1, "totalPages": 1 }
}
PATCH
/mailboxes/:id

Update mailbox settings (display name, quota, status, webhook toggle).

json
{
  "displayName": "Customer Support",
  "status": "suspended"
}
POST
/mailboxes/:id/password

Change the password for a mailbox.

json
{
  "password": "new-secure-password-456"
}
DELETE
/mailboxes/:id

Soft-delete a mailbox. The user will no longer be able to access email via IMAP or POP3.

json
{
  "success": true
}

Aliases

Aliases forward email to an existing mailbox. For example, you can create info@yourdomain.com as an alias for support@yourdomain.com.

POST
/mailboxes/aliases

Create an alias that forwards to an existing mailbox.

json
{
  "domainId": 1,
  "localPart": "info",
  "destinationMailboxId": 1
}
GET
/mailboxes/aliases

List all aliases for the current team.

DELETE
/mailboxes/aliases/:id

Delete an alias.

json
{
  "success": true
}