# Mailboxes, aliases and mail rules

> Switch mail on for a domain, create mailboxes with a quota, add aliases, a catch-all and domain aliases, set an autoresponder or forwarding, and use the mail catcher, mail log and mail queue.

Source: https://www.berthpanel.app/library/mailboxes/ · Category: mail · Updated: 2026-10-30

Every domain in Berth can have its own mail: mailboxes with a quota, aliases and forwards, a catch-all, and per-mailbox rules for an away message or forwarding. This page covers the day-to-day work on the domain's mail page, the matching `berth mail` commands, and the tools for finding out what happened to a message.

Mail runs on Postfix and Dovecot. Mailboxes are stored as Maildir under `/var/qmail/mailnames/<domain>/<mailbox>`, the same layout Plesk uses, so mail taken over from a Plesk server keeps its folders, flags and message UIDs. See [On-disk layout](https://www.berthpanel.app/library/on-disk-layout/).

## Switching mail on for a domain

Mail is off for a new domain until you switch it on.

1. Open the domain and go to the *Mail* tab.
2. Click **Enable mail for example.com**.
3. The panel creates a DKIM key and lists the DNS records the domain needs: MX, SPF, DKIM and DMARC, plus TLS-RPT. If the panel manages the DNS (on its own DNS server or through a linked provider) they are published for you; otherwise copy them to your DNS host from the card **Mail DNS**.
4. Click **Check the DNS records**. The panel asks public resolvers and marks every record as correct, missing or weaker than recommended.

```bash
berth mail enable --domain example.com
berth mail status --domain example.com --check
```

If the domain's MX already points somewhere else, the page says so before you switch mail on, and warns again if mail is on here while the MX points elsewhere: mail from outside would never arrive. For mail at Microsoft 365 or Google Workspace, leave mail off here and use [the provider option](https://www.berthpanel.app/library/mail-import-and-external-providers/) instead. What each record does is explained in [Mail authentication](https://www.berthpanel.app/library/mail-authentication/), and how records get published in [DNS](https://www.berthpanel.app/library/dns/).

## Creating a mailbox

1. On the *Mail* tab, click **Add mailbox**.
2. Enter the part before the @: lowercase letters, digits, dot, hyphen, underscore or plus.
3. Leave the password empty to let the panel generate a strong one, or choose your own of at least 12 characters. The password is shown **once**; copy it straight away.
4. Optionally set a quota in MB.
5. Click **Add mailbox**.

```bash
berth mail account add --address info@example.com --quota-mb 2048
printf '%s\n' "$PW" | berth mail account add --address sales@example.com --password-stdin
```

Each mailbox in the list shows its message count, the space in use against its quota, and when and over which protocol (IMAP, POP3, SMTP) it last signed in. Open a mailbox for its settings. Under the mailbox you also find **Mail log** (that address's mail log), **New password** (`berth mail account password --address …`) and **Delete…**, which removes the mailbox and all its mail after a second confirmation.

The package sets how many mailboxes a subscription may have and the default quota for new ones (`berth plan set --max-mailboxes … --mailbox-quota-mb …`, see [Customers and packages](https://www.berthpanel.app/library/customers-and-packages/)). When the package is full, the form says so. Passwords are stored as SHA512-CRYPT hashes; hashes taken over from another panel keep working. Messages up to 50 MB are accepted.

### Quota

The section *Space* of a mailbox holds its quota. An administrator can set 0 for unlimited; a customer can go up to what the package allows per mailbox. Dovecot enforces the quota: when a mailbox is full, new mail for it is refused already during the SMTP session, so the sending server reports it and this server sends no bounce. Mail is accepted again as soon as there is room, and the mail page shows a warning for mailboxes that are full or nearly full. The quota of an existing mailbox is changed in the panel or through the API (`PATCH /api/v1/domains/{name}/mail/accounts/{local}`).

## Aliases, forwards and the catch-all

An alias is an address without its own mailbox: mail to it goes on to one or more other addresses, on this server or elsewhere.

1. Under **Aliases and forwarding**, go to **Add alias**.
2. Enter the address, and one or more targets, one per line.
3. Leave the address empty for a **catch-all**: every unknown address at the domain then goes to the targets.

```bash
berth mail alias add --domain example.com --local sales --target anna@example.com --target bob@example.nl
berth mail alias add --domain example.com --local "" --target info@example.com   # catch-all
berth mail alias remove --domain example.com --id 12
```

Forwards to outside addresses count towards the subscription's [outbound budget](https://www.berthpanel.app/library/outbound-mail/), like any other mail that leaves the server.

## Domain aliases with mail

A website alias (for example `example.nl` as an alias of `example.com`) can also receive the main domain's mail. Mail to `info@example.nl` then lands in the mailbox `info@example.com`, and that mailbox may also send as `info@example.nl`. Unknown addresses are refused, and the main domain's catch-all also applies to the alias.

Open *More settings → Domain aliases with mail*, pick the alias and click **Enable mail for this alias**. The card lists the DNS records the alias needs. Add the website alias itself first on the domain page.

```bash
berth mail alias-domain --domain example.com --alias example.nl
berth mail alias-domain --domain example.com --alias example.nl --remove
```

## Away message and forwarding per mailbox

Each mailbox has a section **Away and forwarding**. The panel turns it into a Sieve script that Dovecot runs on delivery.

- **Away message**: switch on *Reply automatically*, fill in subject and text, and optionally a last day. Each sender gets at most one reply per day, so two autoresponders never answer each other in a loop.
- **Forwarding**: one or more addresses, one per line. Keep *Also keep a copy in this mailbox* on to keep the mail as well.

Click **Save rules**. From the command line, calling `rules` without flags switches everything off:

```bash
berth mail account rules --address info@example.com --autoreply \
  --subject "Out of office" --body "Back on Monday." --until 2026-12-31
berth mail account rules --address info@example.com --forward anna@example.nl --keep
```

Replies and forwarded mail are sent with the mailbox as envelope sender and count towards the outbound budget. The same mailbox page also has the per-mailbox [spam filter](https://www.berthpanel.app/library/spam-and-antivirus/) and an [OpenPGP key](https://www.berthpanel.app/library/mail-authentication/#openpgp-and-wkd).

## Mail catcher for test sites

On a staging site or during development you rarely want real customers to receive test mail. The *Mail catcher*, linked from the domain page, catches mail that the website sends through PHP (`mail()`, WordPress, Laravel, Symfony) and stores it instead of delivering it.

Click **Catch mail** to switch it on. Caught messages appear in a list with sender, recipient and subject, and you can open each one with its headers and text. The newest 500 are kept; **Remove all** clears them. **Send mail again** switches the catcher off. See also [Staging](https://www.berthpanel.app/library/staging/).

## Mail log: what happened to a message

The *Mail log* tab of the mail page shows, per domain or per address, what happened to mail: delivered, deferred or refused, and who signed in. Lines that belong to the same message are merged, so you see one entry per message instead of a page of raw log lines. You can look back up to 30 days, and search for an address. Customers see only their own domains.

```bash
berth mail log example.com --hours 48
berth mail log example.com --address info --hours 720
```

## Mail queue (administrator)

*Admin → Mail queue* lists mail that has not been delivered yet, with the reason. You can retry, hold, release or delete single messages, retry everything, or delete all deferred messages at once. The same page shows which mailboxes and subscriptions sent the most mail in the last hour; that part is described in [Outbound mail](https://www.berthpanel.app/library/outbound-mail/).

```bash
berth mail queue
berth mail queue --retry 4F2A91C03B --hold 7D11E2A9F0
berth mail queue --flush
```

## Switching mail off

At the bottom of the mail page, *Danger zone → Disable mail* takes the domain's mailboxes and aliases out of the configuration. The mail itself stays on disk, so switching mail on again brings it back. An administrator can also remove the content:

```bash
berth mail disable --domain example.com           # mail stays on disk
berth mail disable --domain example.com --purge   # also delete the Maildirs
```

Backups include every mailbox; to get back a single mailbox or folder, see [Restoring data](https://www.berthpanel.app/library/restoring-data/).
