Aliases, forwarders and catch-all (default address)
Purpose. Route mail for addresses that are not mailboxes, copy a mailbox’s mail elsewhere, and decide what happens to mail for unknown local parts — the cPanel “Forwarders” and “Default Address” features.
Behaviour.
- Alias —
POST /api/v1/domains/{id}/aliases{ localPart, destinations[] }: one address delivering to 1–50 local or remote addresses. Stored as Postfixvirtual_alias_mapsrows (viewv_virtual_aliases), effective immediately. An alias may not collide with a mailbox. Destinations of an alias may use the alias as envelope sender when authenticated (sender-login map).GET,PATCH(destinations,active) andDELETEon/api/v1/aliases/{id}read, change and remove one. - Forwarder —
POST /api/v1/mailboxes/{id}/forwarders{ destination, keepCopy }: attaches to an existing mailbox;keepCopy:true(default) delivers locally and forwards,falseforwards only. Several forwarders per mailbox are allowed, and each is its own routing row, so the mailbox keeps a local copy if any of its forwarders haskeepCopy:true; it forwards only when every one isfalse.GET,PATCH(keepCopy,active—falsepauses the forwarder) andDELETEon/api/v1/forwarders/{id}manage one. Forwarded mail is SRS-rewritten on the way out, so it still passes SPF at the destination (SRS — sender rewriting for forwarded mail). - Catch-all / default address —
PUT /api/v1/domains/{id}/catchall{ destination }: mail for any non-existent local part in the domain goes todestination(Postfix@domainlookup).DELETErestores the default: unknown recipients are rejected at SMTP time (550), which is the safest choice for reputation. There is no “discard” option in v1. - Who may send as these addresses. The sender-login map is built from the same routing view as delivery, so it is not only an alias’s destinations that pass it. As configured, a catch-all’s destination may also be able to send as any address of the domain that is not a mailbox, and a forwarder’s destination as the mailbox that forwards to it; this is read from the configuration and not yet reproduced.
- All three appear in the audit log with before/after snapshots.
Configuration. None; everything is data in Postgres.
Limits & edge cases. A domain routed to another server keeps its aliases, forwarders and catch-all in the database, but none of them applies until it is routed here again: v_virtual_aliases leaves them out. Forwarded mail is SRS-rewritten so it passes SPF at the destination (SRS — sender rewriting for forwarded mail). Alias loops are not detected (Postfix’s virtual_alias_recursion_limit stops them). Suspended mailboxes stop receiving via forwarders too. Aliases and the catch-all inherit their domain’s active flag; a forwarder follows its mailbox’s active and suspended state instead.