# urbestack-mail-domain-set

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 command, run as root in the server shell.

## Usage

```
urbestack-mail-domain-set --name DOMAIN [--routing local|remote] [--web on|off] [--outgoing on|off] [--hourly-limit N|''] [--account-hourly-limit N|''] [--outbound-ip IP|''] [--default-address reject|ADDRESS] [--spam on|off] [--junk-score N|''] [--reject-score N|''] [--junk-folder on|off] [--greylisting on|off] [--dkim on|off] [--owner USER]
```

## Description

Updates mail settings for the domain selected by --name. Supply at least one setting to change.

With --routing local, this server handles the domain's mail, including messages sent by other domains on this server, and the domain's DNS zone carries its mail records. With --routing remote, mail is hosted elsewhere and this server refuses incoming mail for the domain. When mail settings are first created, UrbeStack chooses local routing if public DNS directs the domain's mail here or if the domain has no MX record and its nameservers are delegated to this server. With mail.unpointed_domains set to accept, the domain starts with local routing and no hold even if public DNS does not point here. If none of these conditions applies, the domain starts with remote routing and mail on hold. Public DNS must already direct the domain's mail here to set --routing local with --owner. If there is no MX record, UrbeStack checks the domain's A and AAAA records. An administrator can set local routing before public DNS points here. Setting either routing mode ends any routing hold and disables automatic routing changes for the domain.

--web off stops the domain's website from sending mail. --outgoing off blocks all outgoing mail for the domain, including mail sent by accounts and scripts. --hourly-limit sets the domain-wide limit and --account-hourly-limit sets the per-account limit for the domain. Both accept 0 to 1000000 messages per hour. Pass an empty value to restore the server default for that limit. --outbound-ip selects a sending IP address from dns.ipv4, dns.ipv6 or mail.extra_addresses. Pass an empty value to clear the override.

--default-address controls mail for unknown recipients. Use reject to refuse it during SMTP or supply an email address to forward it there.

With --spam off, mail is delivered without spam markings. Spam filtering is on by default. With --spam on, mail that reaches --reject-score is refused. Other mail that reaches --junk-score is marked as junk and delivered to Junk when --junk-folder is on. Both scores accept values from 0 to 100 with up to one decimal place. Pass an empty value to restore the server default for that score. The junk score must be below the reject score. Customers can set scores only within the range the administrator set.

--greylisting off removes the first-contact delay for the domain. The Junk folder setting and greylisting inherit the server policy by default. DKIM signing is on by default. Use --dkim off to stop signing when the domain uses external DNS that lacks the DKIM record. UrbeStack keeps the key and record so --dkim on resumes signing immediately.

--owner applies the change on behalf of the named customer, who must own the domain. Omit --owner to use the administrator-only options --outgoing, --hourly-limit, --account-hourly-limit and --outbound-ip.

## Same in the API

- [PATCH /domains/{name}/mail](https://urbestack.com/docs/api/patch-domains-name-mail.md): Update the domain's mail settings and spam policy
- [PUT /domains/{name}/mail/default-address](https://urbestack.com/docs/api/put-domains-name-mail-default-address.md): Set how the domain handles mail for unknown recipients

## Command family: mail

- [urbestack-mail-account-add](https://urbestack.com/docs/commands/urbestack-mail-account-add.md): Creates a mail account on a hosted domain and creates its Maildir in the customer's home.
- [urbestack-mail-account-del](https://urbestack.com/docs/commands/urbestack-mail-account-del.md): Removes a mail account and clears its Roundcube contacts, contact groups and identities.
- [urbestack-mail-account-list](https://urbestack.com/docs/commands/urbestack-mail-account-list.md): Lists all mail accounts by default.
- [urbestack-mail-account-set](https://urbestack.com/docs/commands/urbestack-mail-account-set.md): Updates a mail account.
- [urbestack-mail-activity](https://urbestack.com/docs/commands/urbestack-mail-activity.md): Reports activity for one mailbox using the mail logs.
- [urbestack-mail-autoresponder-set](https://urbestack.com/docs/commands/urbestack-mail-autoresponder-set.md): Sets or removes a mailbox's autoresponder.
- [urbestack-mail-check-fix](https://urbestack.com/docs/commands/urbestack-mail-check-fix.md): Applies one fix offered by the mail record check.
- [urbestack-mail-dkim-rotate](https://urbestack.com/docs/commands/urbestack-mail-dkim-rotate.md): Creates a new DKIM key for a domain and starts signing with it.
- [urbestack-mail-domain-get](https://urbestack.com/docs/commands/urbestack-mail-domain-get.md): Shows a domain's mail settings, including its effective spam policy, mail accounts, forwarders, allow and block lists, and DKIM records.
- [urbestack-mail-filter-add](https://urbestack.com/docs/commands/urbestack-mail-filter-add.md): Adds a mail filter to an account (--address) or a domain (--name).
- [urbestack-mail-filter-del](https://urbestack.com/docs/commands/urbestack-mail-filter-del.md): Removes the mail filter selected by --id.
- [urbestack-mail-filter-list](https://urbestack.com/docs/commands/urbestack-mail-filter-list.md): Lists mail filters in the order they run within each account or domain.
- [urbestack-mail-filter-set](https://urbestack.com/docs/commands/urbestack-mail-filter-set.md): Updates the mail filter selected by --id.
- [urbestack-mail-forwarder-add](https://urbestack.com/docs/commands/urbestack-mail-forwarder-add.md): Adds a forwarder for an email address on an existing domain.
- [urbestack-mail-forwarder-del](https://urbestack.com/docs/commands/urbestack-mail-forwarder-del.md): Removes a forwarder.
- [urbestack-mail-forwarder-list](https://urbestack.com/docs/commands/urbestack-mail-forwarder-list.md): Lists all forwarders by default.
- [urbestack-mail-forwarder-set](https://urbestack.com/docs/commands/urbestack-mail-forwarder-set.md): Replaces the entire destination list of an existing forwarder.
- [urbestack-mail-greylist-list](https://urbestack.com/docs/commands/urbestack-mail-greylist-list.md): Lists messages deferred by greylisting.
- [urbestack-mail-greylist-pass](https://urbestack.com/docs/commands/urbestack-mail-greylist-pass.md): Lets mail deferred by greylisting pass at its next retry, whenever it arrives.
- [urbestack-mail-hold-check](https://urbestack.com/docs/commands/urbestack-mail-hold-check.md): Checks public DNS for domains whose mail is on hold and activates mail when a domain uses this server's nameservers or its MX record points here.
- [urbestack-mail-install](https://urbestack.com/docs/commands/urbestack-mail-install.md): Installs the UrbeStack mail stack, including Postfix, Dovecot, Rspamd with its key-value store, and Roundcube.
- [urbestack-mail-learn](https://urbestack.com/docs/commands/urbestack-mail-learn.md): Trains Rspamd on copies Dovecot supplies when customers move messages into Junk (spam) or out of Junk (ham).
- [urbestack-mail-list-add](https://urbestack.com/docs/commands/urbestack-mail-list-add.md): Adds entries to a domain's mail sender list or, with --server, to a server-wide list.
- [urbestack-mail-list-del](https://urbestack.com/docs/commands/urbestack-mail-list-del.md): Removes an entry from a domain's mail sender list or, with --server, from a server-wide list.
- [urbestack-mail-list-list](https://urbestack.com/docs/commands/urbestack-mail-list-list.md): Lists entries that allow senders, block senders or exempt them from greylisting.
- [urbestack-mail-log](https://urbestack.com/docs/commands/urbestack-mail-log.md): Reads the latest lines from the end of the mail log.
- [urbestack-mail-queue-del](https://urbestack.com/docs/commands/urbestack-mail-queue-del.md): Deletes selected messages from the Postfix queue or empties it with --all.
- [urbestack-mail-queue-deliver](https://urbestack.com/docs/commands/urbestack-mail-queue-deliver.md): Asks Postfix to attempt delivery of one queued message immediately using postqueue -i.
- [urbestack-mail-queue-flush](https://urbestack.com/docs/commands/urbestack-mail-queue-flush.md): Asks Postfix to retry delivery of every queued message immediately.
- [urbestack-mail-queue-hold](https://urbestack.com/docs/commands/urbestack-mail-queue-hold.md): Holds one queued message with postsuper -h.
- [urbestack-mail-queue-list](https://urbestack.com/docs/commands/urbestack-mail-queue-list.md): Lists every message waiting in the Postfix queue, with its sender, recipients and any delay reasons.
- [urbestack-mail-queue-view](https://urbestack.com/docs/commands/urbestack-mail-queue-view.md): Displays one queued message in full, with headers and body as printed by postcat -q.
- [urbestack-mail-settings-set](https://urbestack.com/docs/commands/urbestack-mail-settings-set.md): Saves one or more mail.* settings together.
- [urbestack-mail-smarthost-set](https://urbestack.com/docs/commands/urbestack-mail-smarthost-set.md): Sets the smarthost for the server's outgoing mail or, with --name, for one domain.
- [urbestack-mail-stats](https://urbestack.com/docs/commands/urbestack-mail-stats.md): Reports Rspamd's counters for messages scanned, actions taken and Bayes learning, along with today's mail log totals from pflogsumm and the Postfix queue size.
- [urbestack-mail-status](https://urbestack.com/docs/commands/urbestack-mail-status.md): Reports whether the mail stack is installed and enabled, how many mailboxes it serves across how many domains, its SMTP greeting hostname and its outbound IP addresses.
- [urbestack-mail-trace](https://urbestack.com/docs/commands/urbestack-mail-trace.md): Finds messages in the mail logs and shows what happened to them.
