This function creates a Mail Exchanger (MX) record. For more information about MX record settings, read our Email Routing Configuration documentation.
Important:
When you disable the Receive Mail role, the system disables this function
domain required | string The new mail exchanger's domain. Example: |
exchanger required | string The new mail exchanger's name. Example: |
priority required | integer The new mail exchanger's priority value. Note: It is common practice to set a priority value that is divisible by five. Example: |
alwaysacce | integer Default: Whether the mail exchanger accepts all mail for the domain.
Example: |
HTTP Request was successful.
apiversion | integer The version of the API. |
func | string The name of the method called. |
module | string The name of the module called. |
object |
uapi --output=jsonpretty \ --user=username \ Email \ add_mx \ domain='example.com' \ exchanger='mail.example.com' \ priority='5'
{- "apiversion": 3,
- "func": "add_mx",
- "module": "Email",
- "result": {
- "data": {
- "checkmx": {
- "changed": 1,
- "detected": "auto",
- "isprimary": 0,
- "issecondary": 0,
- "local": 0,
- "mxcheck": "auto",
- "remote": 0,
- "secondary": 0,
- "warnings": [
- "Auto Detect of MX configuration not possible due to non-resolving MX entries. Defaulting to last known setting: local."
]
}, - "results": "Added entry:\\nBind reloading on example using rndc zone: [example.com]\\n",
- "status": 1,
- "statusmsg": "Added entry:\\nBind reloading on example using rndc zone: [example.com]\\n"
}, - "errors": null,
- "messages": null,
- "metadata": { },
- "status": 1,
- "warnings": null
}
}