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 Server | Your PostStack hostname |
| Port | 993 |
| Security | SSL/TLS |
| Username | Full email address (e.g., user@yourdomain.com) |
| Incoming (POP3) | |
| POP3 Server | Your PostStack hostname |
| Port | 995 |
| Security | SSL/TLS |
| Outgoing (SMTP) | |
| SMTP Server | Your PostStack hostname |
| SMTP Port | 465 |
| SMTP Security | SSL/TLS |
| SMTP Auth | Same 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
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);/mailboxesCreate a new mailbox on a verified domain with inbound enabled.
{
"domainId": 1,
"localPart": "support",
"password": "secure-password-123",
"displayName": "Support Team",
"quotaBytes": 1073741824,
"webhookEnabled": true
}/mailboxesList all mailboxes for the current team with pagination.
{
"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 }
}/mailboxes/:idUpdate mailbox settings (display name, quota, status, webhook toggle).
{
"displayName": "Customer Support",
"status": "suspended"
}/mailboxes/:id/passwordChange the password for a mailbox.
{
"password": "new-secure-password-456"
}/mailboxes/:idSoft-delete a mailbox. The user will no longer be able to access email via IMAP or POP3.
{
"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.
/mailboxes/aliasesCreate an alias that forwards to an existing mailbox.
{
"domainId": 1,
"localPart": "info",
"destinationMailboxId": 1
}/mailboxes/aliasesList all aliases for the current team.
/mailboxes/aliases/:idDelete an alias.
{
"success": true
}