Get an API key
Domain

mail.disable()

domain.mail.disable({ subdomain? }) → Promise<Result>

Removes mail from a host — only the records we posed. The customer's own records stay, and the signing key is kept.

only what we posedthe key is keptper host
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

await domain.mail.disable();                      // the apex
await domain.mail.disable({ subdomain: "team" });
domain.mail.disable()                     # the apex
domain.mail.disable(subdomain="team")

Only what we posed

A sender policy that was there before us is not ours to remove

Nor is an ownership record, nor an old mail server. Removing a customer's own records while cleaning up ours would be the worst kind of helpful.

The signing key is kept

A new key makes already-sent mail unverifiable

Recipients check signatures days later. Re-enabling must find the same key — so disabling keeps it, and the response says so.

Mailboxes stop receiving

The routing records go, so addresses on that host no longer arrive. The mailboxes themselves are not deleted — check hosts() for the count before disabling.

It is per host

Disabling a subdomain leaves the apex alone, and the other way round.

Re-enabling

enable() poses the records again with the same key. Nothing of what was sent becomes unverifiable.