Domain

mail.hosts()

domain.mail.hosts() → Promise<Host[]>

Every host on this domain where mail is enabled, with its witnesses, its selector and how many mailboxes it carries.

freeapex and subdomainsmailbox counts
Using Python?

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

for (const host of await domain.mail.hosts()) {
  console.log(host.host, host.ready ? "ready" : "incomplete", host.mailboxes, "mailboxes");
}
for host in domain.mail.hosts():
    print(host["host"], "ready" if host["ready"] else "incomplete", host["mailboxes"], "mailboxes")
hoststring

The full hostname — the apex, or a subdomain.

selectorstring

The signing key's selector.

mxOk · spfOk · dkimOk · dmarcOkboolean

The four witnesses.

readyboolean

All four, and the domain active.

mailboxesinteger

How many addresses exist on it.

enabledAtstring

When it was configured.

Why there can be several

Mail is configured per host, not per domain

An apex that already receives elsewhere, a subdomain for the team, another for notifications — each has its own records, its own key and its own policy. A policy on the apex does not cover a subdomain.

mailboxes is what makes a host hard to remove

Disabling a host with mailboxes on it stops those addresses receiving. The count is here so that can be said before it happens.

A host that is not ready

Call enable() again on it: it poses what is missing and changes nothing else.