Update Mail Exchanger type
This function sets the Mail Exchanger (MX) type.
Note:
This function only affects the cPanel configuration. You must configure the mail exchanger's DNS entry separately.
Important:
When you disable the DNS role, the system disables this function.
Request
- Base URLhttps://cpanel-server.tld:2083/execute
- AuthHTTP basic
Query parameters
The mail exchanger's domain.
The mail exchanger type.
- auto — Allow cPanel to determine the appropriate role.
- local — Always accept the domain's mail.
- secondary — Accept mail until a higher priority mail server is available.
- remote — Do not accept mail.
Note:
This parameter is redundant with the mxcheck parameter. Do not enter the mxcheck and alwaysaccept parameters at the same time. Undefined behavior may occur if this happens.
The mail exchanger type.
- auto — Allow cPanel to determine the appropriate role.
- local — Always accept the domain's mail.
- secondary — Accept mail until a higher priority mail server is available.
- remote — Do not accept mail.
Note:
This parameter is redundant with the alwaysaccept parameter. Do not enter the mxcheck and alwaysaccept parameters at the same time. Undefined behavior may occur if this happens.
Response
HTTP Request was successful.
Example response
{
"apiversion": 3,
"func": "set_always_accept",
"module": "Email",
"result": {
"data": {
"checkmx": {
"changed": 1,
"detected": "auto",
"mxcheck": "auto",
"warnings": [
"Auto Detect of MX configuration not possible due to non-resolving MX entries. Defaulting to last known setting: local."
]
},
"detected": "auto",
"mxcheck": "auto",
"results": "Set Always Accept Status to: local",
"status": 1,
"statusmsg": "Set Always Accept Status to: local"
},
"status": 1
}
}Changes
No recorded changes to this operation across all 5 revisions of this API.