We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.

We will continue to maintain our API documentation on this server.

Child pages
  • WHM API 1 Functions - unset_manual_mx_redirects
Skip to end of metadata
Go to start of metadata

Description

This function removes a domain's manual Exim mail exchanger (MX) redirect entry. The function also removes the manual MX redirect entry from the /etc/manualmx file.

Note:

To set a domain's manual MX redirection, use the WHM API 1 set_manual_mx_redirects function.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/unset_all_proxy_backends?api.version=1&domain=example.com
 Command Line
whmapi1 unset_manual_mx_redirects domain=example.com


Notes:

  • Unless otherwise noted, you must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
	"metadata": {
		"command": "unset_manual_mx_redirects",
		"reason": "OK",
		"version": 1,
		"result": 1
	},
	"data": {
		"payload": {
			"example.com": "mailhostexample.com"
		}
	}
}


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
domain

string

Required

The domain for which to remove a manual MX redirect entry.

Note:

To remove multiple domain entries, increment the parameter. For example, use the domaindomain-1, and domain-2 parameters.

A valid domain.example.com

Returns

ReturnTypeDescriptionPossible valuesExample
payloadhashA hash that contains a list of domains and the removed manual MX redirect entries.Each hash contains the DOMAIN return.

DOMAIN

string

The domain for which the function removed the manual MX redirect entry.

Note:

This return's name is the domain parameter's value.

The function returns this value in the payload hash.

  • A domain.
  • null — The domain did not have a manual MX redirect entry.
mailhostexample.com