Child pages
  • WHM API 1 Functions - cpgreylist_trust_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 trusted. Greylisting will not defer emails from trusted IP addresses.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/cpgreylist_trust_entries_for_common_mail_provider?api.version=1&provider=cpanel&provider-0=dpanel
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/cpgreylist_trust_entries_for_common_mail_provider?api.version=1&provider=cpanel&provider-0=dpanel
 Command Line
whmapi1 cpgreylist_trust_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_trusted": {
      "cpanel": {
        "ips_trusted": 21
      }
    },
    "providers_failed": {
      "dpanel": "Unknown mail provider: dpanel\n"
    }
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "cpgreylist_trust_entries_for_common_mail_provider"
  }
}
 Output (XML)
<result>
    <data>
        <providers_trusted>
            <cpanel>
                <ips_trusted>21</ips_trusted>
            </cpanel>
        </providers_trusted>
        <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, and 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_trustedhashA hash of the mail providers that Greylisting trusts.This hash includes the provider_key hash. 

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_trusted hash.

This hash includes the ips_trusted return.

 

ips_trusted

integer

The total number of the mail provider's IP addresses that Greylisting trusts.

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 provider failed to update.

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.