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

 

Description

This function marks the IP addresses for the specified mail provider as not trusted. Greylisting defers emails from non-trusted IP addresses.

 

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/cpgreylist_untrust_entries_for_common_mail_provider?api.version=1&provider=cpanel&provider-0=dpanel
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/cpgreylist_untrust_entries_for_common_mail_provider?api.version=1&provider=cpanel&provider-0=dpanel
 Command Line
whmapi1 cpgreylist_untrust_entries_for_common_mail_provider provider=cpanel provider-0=dpanel


Notes:

  • 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)
{
  "data": {
    "providers_untrusted": {
      "cpanel": {
        "ips_untrusted": 21
      }
    },
    "providers_failed": {
      "dpanel": "Unknown mail provider: dpanel\n"
    }
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "cpgreylist_untrust_entries_for_common_mail_provider"
  }
}
 Output (XML)
<result>
    <data>
        <providers_untrusted>
            <cpanel>
                <ips_untrusted>21</ips_trusted>
            </cpanel>
        </providers_untrusted>
        <providers_failed>
            <dpanel>Unknown mail provider: dpanel\n</dpanel>
        </providers_failed>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>cpgreylist_trust_entries_for_common_mail_provider</command>
    </metadata>
</result>


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
providerstring

Required.

The mail provider.

Note:

To trust multiple mail providers, increment the parameter name (for example, provider-0, provider-1, provider-2).

Call WHM API 1's cpgreylist_load_common_mail_providers_config function to return a list of valid provider keys.

cpanel

Returns

Return

TypeDescriptionPossible valuesExample
providers_untrustedhashA hash of the mail providers that Greylisting does not trust.This hash includes the provider_key return. 

provider_key

hash

A hash of the mail provider's data.

Note:

The hash's name is the mail provider's key name.

The function returns this hash in the providers_untrusted hash.

This hash includes the ips_untrusted return.

 

ips_untrusted

integer

The total number of the mail provider's IP addresses that Greylisting does not trust.

The function returns this value in the provider_key hash.

A positive integer.

21

providers_failed

hash

A hash of the mail providers that failed to update.

This hash includes the provider_key return.

 

provider_key*

string

The reason why the change for a provider failed.

Note:

The return's name is the mail provider's key name.

The function returns this value in the providers_failed hash.

A valid string.Unknown mail provider.