---
title: "Update Mail Exchanger type"
method: GET
path: "/Email/set_always_accept"
tags: ["Email", "Email Server Information"]
---

# Update Mail Exchanger type

`GET /Email/set_always_accept`

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](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function.

## Query parameters

- `domain` string, domain, required
- `alwaysaccept` 'auto' | 'local' | 'secondary' | 'remote'
- `mxcheck` 'auto' | 'local' | 'secondary' | 'remote'

## Response `200`

HTTP Request was successful.

- object
  - `apiversion` integer — The version of the API.
  - `func` string — The name of the method called.
  - `module` string — The name of the module called.
  - `result` object
    - `data` object
      - `checkmx` object — An object containing the mail exchanger's data.
        - `changed` 0 | 1 — Whether a change occurred during the function. * `1` — Change occurred. * `0` — **No** change.
        - `detected` 'auto' | 'local' | 'secondary' | 'remote' — 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.
        - `isprimary` 0 | 1 — Whether the mail exchanger is the primary mail exchanger. * `1` — Primary. * `0` — **Not** primary.
        - `issecondary` 0 | 1 — Whether the mail exchanger is a secondary exchanger. * `1` — Secondary. * `0` — **Not** secondary.
        - `local` 0 | 1 — Whether the mail exchanger is a local exchanger. * `1` — Local. * `0` — **Not** local.
        - `mxcheck` 'auto' | 'local' | 'secondary' | 'remote' — 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.
        - `remote` 0 | 1 — Whether the mail exchanger is a remote exchanger. * `1` — Remote. * `0` — **Not** remote.
        - `secondary` 0 | 1 — Whether the mail exchanger is a secondary exchanger. * `1` — Secondary. * `0` — **Not** secondary.
        - `warnings` string[] — An array of warning messages, if any exist. One or more warning messages.
      - `detected` string — 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.
      - `local` 0 | 1 — Whether the mail exchanger is a local exchanger. * `1` — Local. * `0` — **Not** local.
      - `mxcheck` string — 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.
      - `remote` 0 | 1 — Whether the mail exchanger is a remote exchanger. * `1` — Remote. * `0` — **Not** remote.
      - `results` string — A message of success or a reason for failure. * A message of success that includes the new type. * A string that describes an error.
      - `secondary` 0 | 1 — Whether the mail exchanger is a secondary exchanger. * `1` — Secondary. * `0` — **Not** secondary.
      - `status` 0 | 1 — Whether the function succeeded. * `1` — Success. * `0` — Failure.
      - `statusmsg` string — A message of success or a reason for failure. * A message of success that includes the new type. * A string that describes an error.
    - `errors` string[], nullable — List of errors if the API failed.
    - `messages` string[], nullable — List of messages generated by the API.
    - `metadata` object
    - `status` 0 | 1 — * `1` — Success. * `0` — Failed. Check the `errors` field for more details.
    - `warnings` string[], nullable — List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.

---

[API](https://skmtc.net/cpanel/apis/cpanel-uapi.md) · [All operations](https://skmtc.net/cpanel/apis/cpanel-uapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpanel/cpanel-uapi/revisions/632e2f8e6d04/schema)
