Admin

Managing Mail Domains

Add, edit, and delete mail domains in Opterius Mail admin, and understand how domain records relate to accounts and aliases.

Last updated 2026-04-12
  • Editing a Domain
  • Understanding Catch-All Addresses
  • Domain Statistics
  • Deleting a Domain
  • DNS Requirements for a Domain
  • Managing Mail Domains

    Mail domains represent the @example.com part of an email address. Every account and alias in Opterius Mail belongs to a domain. Domain records are stored in the mail_domains table and serve as the parent record for all accounts, aliases, and DKIM keys associated with that domain.

    Viewing Domains

    Navigate to Admin → Domains. The domains list shows:

    Column Description
    Domain The domain name (e.g., example.com)
    Accounts Count of active accounts under this domain
    Aliases Count of aliases defined for this domain
    Catch-all The catch-all address if one is configured, or — if none
    Added Date the domain was first registered in Opterius Mail

    Click any domain name to open its detail/edit view.

    Adding a Domain

    1. Click Add Domain in the top-right corner.
    2. Enter the domain name — for example, example.com. Do not include @ or any subdomain prefix.
    3. Optionally set a catch-all address at this point (you can also set it later when editing).
    4. Click Save.

    The domain appears in the list immediately. You can now create accounts and aliases for it.

    Standalone Mode vs Panel Integration

    In standalone mode (no Opterius Panel), you add domains manually whenever you need to start hosting email for a new domain.

    With Opterius Panel integration, domains are created automatically. When the Panel's Go agent creates the first email account for a domain that does not yet exist in mail_domains, the sync endpoint (POST /api/sync/account) creates the domain record automatically before inserting the account. Manual domain creation is still supported but rarely needed in panel-integrated deployments.

    Editing a Domain

    Click the domain name, or use the Edit button (pencil icon) in the domains list.

    Editable fields:

    Field Notes
    Domain name Can be changed if no DNS or external dependency conflicts. Renaming a domain updates all child account and alias records.
    Catch-all address Any email sent to an address that does not match an account or alias is forwarded here. Enter a full email address, e.g. admin@example.com. Leave blank to disable (unmatched addresses bounce).

    Understanding Catch-All Addresses

    A catch-all address is useful when:

    • You want to ensure no mail is silently dropped.
    • You have published addresses like noreply@example.com that you want delivered somewhere.
    • You are migrating and are not sure which addresses were in use.

    Be cautious with catch-all addresses — they attract significant amounts of spam sent to random addresses at your domain. Consider using a dedicated filtering mailbox rather than a primary inbox.

    The catch-all is implemented as an alias record: *@example.com → {catch-all address} in the Postfix virtual_alias_maps.

    Domain Statistics

    The detail view for a domain shows:

    • Full list of accounts with quota usage
    • Full list of aliases
    • DKIM key status
    • Total storage used across all accounts (sum of Maildir sizes)

    Deleting a Domain

    Click the Delete button on the domain detail page. You will be prompted to confirm with your admin password.

    Deleting a domain is a destructive, cascading action:

    • All accounts under the domain are deleted from mail_accounts.
    • All aliases for the domain are deleted from mail_aliases.
    • All DKIM key records for the domain are deleted.
    • Autoresponders for accounts in this domain are deleted.
    • Group memberships for accounts in this domain are removed.

    What is not deleted automatically:

    • Maildir data on disk — the actual email files in /var/mail/{domain}/ remain. You must remove them manually if you want to reclaim disk space.
    • DNS records — remove the MX, SPF, DKIM, and DMARC records from your DNS provider manually.

    Warning: Domain deletion cannot be undone from within the application. Always verify you have a database and Maildir backup before deleting a domain.

    DNS Requirements for a Domain

    After adding a domain in Opterius Mail, ensure these DNS records are in place at your registrar or DNS provider:

    ; MX record — points inbound mail to your server
    example.com.    IN  MX  10  mail.example.com.
    
    ; A record for the mail hostname
    mail.example.com.  IN  A   203.0.113.1
    
    ; SPF record — authorizes your server to send for this domain
    example.com.    IN  TXT  "v=spf1 a mx ~all"
    
    ; DKIM record — added after generating the key in Admin → DKIM
    mail._domainkey.example.com.  IN  TXT  "v=DKIM1; k=rsa; p=..."
    
    ; DMARC record — optional but recommended
    _dmarc.example.com.  IN  TXT  "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com"