Email
Email Server Information
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.
get/Email/set_always_accept
Query parameters
domainstring domain required
Example:example.com
The mail exchanger's domain.
alwaysaccept'auto' | 'local' | 'secondary' | 'remote'
Example:auto
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.
mxcheck'auto' | 'local' | 'secondary' | 'remote'
Example:auto
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
}
}