API operation · mail group
PUT
/domains/{name}/mail/default-address
First published 3 Oct 2026
0.1.0Unchanged since publicationSet how the domain handles mail for unknown recipients
Who may call it
AdministratorResellerCustomer
Token scope, any of
mailallAnswers200 OK
Set action to reject to refuse mail for unknown recipients during SMTP. Set action to forward and supply a valid email address in to to forward that mail.
An administrator, the domain's owner, or the owner's reseller can call this operation with a token that has the mail scope. A 200 response returns the updated mail object in the same format as GET /domains/{name}/mail.
As commands
Run as root on the serverParameters
namepath ·DomainNameRequiredactionstring, one of reject, forwardRequiredAn email address in local@domain form.
Example
See the API overview for how to set $API and $TOKEN.Request
curl -sS -X PUT "$API/domains/example.com/mail/default-address" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "reject",
"to": "text"
}'Response ·
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
24 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 text without control characters, 1 to <max> characters400Domain 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 reserved401Authentication required404No such domain: <name>404Setting '<key>' not found409The mail of <name> is not received here yet: its MX record No error of this operation matches.
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.1.0 on 3 Oct 2026.
urbestack.com/docs/api/put-domains-name-mail-default-address/