Return mail exchanger records

This function lists Mail Exchanger (MX) records.

Important:

When you disable the DNS role, the system disables this function.

Authorizations:
query Parameters
domain
string <domain>

The domain to query. If you do not use this parameter, the function returns MX records for all of the cPanel account's domains.

Example: domain=example.com

Responses

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object

Request samples

uapi --output=jsonpretty \
  --user=username \
  Email \
  list_mxs

Response samples

Content type
application/json
{
  • "apiversion": 3,
  • "func": "list_mxs",
  • "module": "Email",
  • "result": {
    • "data": [
      • {
        • "alwaysaccept": 1,
        • "detected": "local",
        • "domain": "example.com",
        • "entries": [
          • {
            • "domain": "example.com",
            • "entrycount": 1,
            • "mx": "mx.example.com",
            • "priority": 5,
            • "row": "odd"
            }
          ],
        • "local": 1,
        • "mx": "mx.example.com",
        • "mxcheck": "auto",
        • "remote": 0,
        • "secondary": 0,
        • "status": 1,
        • "statusmsg": "Fetched MX List"
        }
      ],
    • "errors": null,
    • "messages": null,
    • "metadata": {
      • "transformed": 1
      },
    • "status": 1,
    • "warnings": null
    }
}