v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
Email
Email Filtering

Run test for main domain email filters

This function tests mail filters. The function only tests filters for the cPanel account's main domain, and only tests against the message's body. For more information about Exim filters, read Exim's documentation.

Note:

If the domain or account does not contain a filter file, this function will fail.

Important:

When you disable the Receive Mail role, the system disables this function.

get/Email/trace_filter

Query parameters

msgstring required
Example:Test

The string to test. The function uses this string as the body of an email message, to check whether filters would match the string.

accountstring email
Example:user@example.com

The email address, to test legacy cPanel filters in the filters directory. If you do not use this parameter, the function tests the main domain's filters in the /etc/vfilters directory.

Response

HTTP Request was successful.

apiversioninteger

The version of the API.

funcstring

The name of the method called.

modulestring

The name of the module called.

Example response

{
  "apiversion": 3,
  "func": "trace_filter",
  "module": "Email",
  "result": {
    "data": {
      "trace": "Warning: no message headers read\\nReturn-path copied from sender\\nSender = user@example.com\\nRecipient = user@example.com\\nTesting Exim filter file &quot;/etc/vfilters/example.com&quot;\\n\\nFiltering did not set up a significant delivery.\\n<b>Normal delivery will occur.\\n</b>"
    },
    "status": 1
  }
}