/domains/{name}/mail
0.1.0Unchanged since publicationUpdate the domain's mail settings and spam policy
mailallSupply at least one setting to change. The API returns 400 if no setting is supplied or routing is invalid. An administrator, the domain's owner, or the owner's reseller can call this operation with a token that has the mail scope. Only an administrator can set outgoing, hourly_limit, account_hourly_limit, or outbound_ip. A 200 response returns the updated mail object and the mail reload result in reload.
Set routing to local to handle the domain's mail on this server, including mail sent by other domains on the server, and publish its mail records in the DNS zone. Set routing to remote when mail is hosted elsewhere. This server then refuses incoming mail for the domain. For a customer or reseller to set local routing, public DNS must direct the domain's mail to this server. UrbeStack checks A and AAAA records if there is no MX record. An administrator can set local routing before public DNS points here. Setting either mode ends any routing hold and disables automatic routing changes for the domain.
When mail settings are first created, routing starts as local if public DNS directs mail here or if the domain has no MX record and its nameservers are delegated to this server. Setting mail.unpointed_domains to accept also lets the domain start with local routing and no hold. Otherwise, routing starts as remote with mail on hold.
Set web to false to stop the domain's website from sending mail. Set outgoing to false to block all outgoing mail for the domain, including mail sent by accounts and scripts. The hourly_limit and account_hourly_limit fields set the domain-wide and per-account limits, respectively. Each accepts a whole number from 0 to 1000000 messages per hour. Use null or an empty string to restore the server default for either limit. The outbound_ip field selects a sending IP address from dns.ipv4, dns.ipv6, or mail.extra_addresses. Use null or an empty string to clear the override.
Spam filtering is on by default. Set spam to false to deliver mail without spam markings. When filtering is on, UrbeStack rejects mail at or above reject_score. For mail below that threshold, UrbeStack marks messages at or above junk_score as junk and delivers them to Junk if junk_folder is enabled. Both scores accept values from 0 to 100 with up to one decimal place. Use null or an empty string to restore the server default for either score. The junk_score must be below reject_score. Customers can set scores only within the range the administrator configured.
The junk_folder and greylisting fields inherit the server policy by default. Set greylisting to false to remove the first-contact delay. DKIM signing is on by default. Set dkim to false to stop signing if the domain uses external DNS without its DKIM record. UrbeStack keeps the key and record so signing resumes immediately when dkim is set to true.
As commands
Run as root on the serverParameters
namepath ·DomainNameRequiredaccount_hourly_limitinteger, 0 to 1000000 or nulldkimbooleangreylistingbooleanhourly_limitinteger, 0 to 1000000 or nulljunk_folderbooleanjunk_scorenumber or nulloutbound_ipstring, up to 45 characters or nulloutgoingbooleanreject_scorenumber or nullroutingstring, one of local, remotespambooleanwebbooleanExample
See the API overview for how to set $API and $TOKEN.curl -sS -X PATCH "$API/domains/example.com/mail" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"account_hourly_limit": 1,
"dkim": true,
"greylisting": true,
"hourly_limit": 1,
"junk_folder": true,
"junk_score": 1,
"outbound_ip": "text",
"outgoing": true,
"reject_score": 1,
"routing": "local",
"spam": true,
"web": true
}'200 OK{
"mail": {
"account_hourly_limit": 1,
"accounts": [
{
"address": "info@example.com",
"autoresponder": {
"body": "text",
"end": "text",
"interval_days": 1,
"start": "text",
"subject": "text"
},
"created_at": "2026-09-09T10:15:00Z",
"domain": "example.com",
"home": "text",
"hourly_limit": 1,
"id": 1,
"local_part": "text",
"login_suspended": 1,
"outgoing_suspended": 1,
"quota_mb": 1,
"updated_at": "text",
"usage": {
"messages": 1,
"storage_kb": 1,
"storage_limit_kb": 1
}
}
],
"certificate": {
"covers_mail": true,
"covers_webmail": true,
"installed": true
},
"check_resolvers": [
"text"
],
"default_address": {},
"delegated_here": "yes",
"dkim": [
{}
],
"dkim_selector": "text",
"domain": "example.com",
"filters": [
{
"action": {
"action": "folder",
"target": "https://example.com/new"
},
"address": "info@example.com",
"created_at": "2026-09-09T10:15:00Z",
"domain": "example.com",
"id": 1,
"name": "alice",
"position": 1,
"rules": {}
}
],
"forwarders": [
{
"address": "info@example.com",
"created_at": "2026-09-09T10:15:00Z",
"destinations": [
"text"
],
"domain": "example.com",
"id": 1,
"local_part": "text"
}
],
"hold": 1,
"hold_checked_at": "text",
"hold_ended_at": "text",
"hold_ended_by": "text",
"hold_nameservers": [
"text"
],
"hold_since": "text",
"hourly_limit": 1,
"lists": [
{
"created_at": "2026-09-09T10:15:00Z",
"domain": "example.com",
"entry": "text",
"id": 1,
"kind": "profile"
}
],
"outbound_ip": "text",
"outgoing_suspended": 1,
"policy": {
"dkim": 1,
"enabled": 1,
"greylisting": 1,
"junk_folder": 1,
"junk_score": 1,
"reject_score": 1
},
"public_nameservers": [
"text"
],
"records": [
{
"content": "text",
"key": "panel.port",
"name": "alice",
"type": "rebuild",
"zone": "text"
}
],
"routing": "text",
"server_addresses": [
"text"
],
"server_policy": {},
"smarthost": {
"has_password": true,
"host": "text",
"port": 8443,
"tls": true,
"user": "alice"
},
"spam": {},
"user": "alice",
"web_sending": 1,
"webmail_url": "text",
"zone": "text"
}
}Errors
27 errors, each a status and a sentence400--name is required400<ip> is not one of this server's addresses (dns.ipv4, dns.ipv6, mail.extra_addresses)400<what> must be a whole number from 0 to <max>400<what> must be text without control characters, 1 to <max> characters400A score is a number, with up to two decimals400Domain name required400Domain name too long400Invalid IPv4 address400Invalid IPv6 address400Invalid boolean400Invalid domain name400Invalid mail address400Invalid mail address: local part over 64 characters400Invalid mail address: no local part400Invalid mail address: the local part may hold letters, digits, dots, _ + and -400Invalid port400Invalid setting key400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter400Nothing to change400Routing is local or remote400The junk score must be below the reject score400Username '<value>' is reserved400routing must be local or remote401Authentication required404No such domain: <name>404Setting '<key>' not found409The mail of <name> is not received here yet: its MX record urbestack.com/docs/api/patch-domains-name-mail/