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

 

Description

This function lists Greylisting's IP addresses for the specified mail provider.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/cpgreylist_list_entries_for_common_mail_provider?api.version=1&provider=cpanel&provider-0=dpanel
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/cpgreylist_list_entries_for_common_mail_provider?api.version=1&provider=cpanel&provider-0=dpanel
 Command Line
whmapi1 cpgreylist_list_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": {
      "cpanel": {
        "ips": [
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "208.115.214.0-208.115.214.255"
          },
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "74.63.202.0-74.63.202.255"
          },
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "75.126.200.128-75.126.200.159"
          },
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "75.126.253.0-75.126.253.255"
          },
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "67.228.50.32-67.228.50.63"
          },
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "174.36.80.208-174.36.80.223"
          },
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "174.36.92.96-174.36.92.127"
          },
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "69.162.98.0-69.162.98.255"
          },
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "74.63.194.0-74.63.194.255"
          },
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "74.63.234.0-74.63.234.255"
          },
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "74.63.235.0-74.63.235.255"
          },
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "205.201.128.0-205.201.143.255"
          },
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "198.2.128.0-198.2.191.255"
          },
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "198.2.128.0-198.2.128.255"
          },
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "198.2.132.0-198.2.135.255"
          },
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "198.2.136.0-198.2.137.255"
          },
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "198.2.186.0-198.2.187.255"
          },
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "205.201.131.128-205.201.131.255"
          },
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "205.201.134.128-205.201.134.255"
          },
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "205.201.136.0-205.201.137.255"
          },
          {
            "is_trusted": 1,
            "create_time": "2015-07-28 08:16:52",
            "provider_id": 7,
            "host_ip": "205.201.139.0-205.201.139.255"
          }
        ]
      }
    },
    "providers_failed": {
      "dpanel": "Unknown mail provider: dpanel\n"
    }
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "cpgreylist_list_entries_for_common_mail_provider"
  }
}
 Output (XML)
<result>
    <data>
        <providers>
            <cpanel>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>208.115.214.0-208.115.214.255</host_ip>
                </ips>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>74.63.202.0-74.63.202.255</host_ip>
                </ips>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>75.126.200.128-75.126.200.159</host_ip>
                </ips>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>75.126.253.0-75.126.253.255</host_ip>
                </ips>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>67.228.50.32-67.228.50.63</host_ip>
                </ips>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>174.36.80.208-174.36.80.223</host_ip>
                </ips>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>174.36.92.96-174.36.92.127</host_ip>
                </ips>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>69.162.98.0-69.162.98.255</host_ip>
                </ips>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>74.63.194.0-74.63.194.255</host_ip>
                </ips>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>74.63.234.0-74.63.234.255</host_ip>
                </ips>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>74.63.235.0-74.63.235.255</host_ip>
                </ips>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>205.201.128.0-205.201.143.255</host_ip>
                </ips>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>198.2.128.0-198.2.191.255</host_ip>
                </ips>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>198.2.128.0-198.2.128.255</host_ip>
                </ips>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>198.2.132.0-198.2.135.255</host_ip>
                </ips>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>198.2.136.0-198.2.137.255</host_ip>
                </ips>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>198.2.186.0-198.2.187.255</host_ip>
                </ips>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>205.201.131.128-205.201.131.255</host_ip>
                </ips>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>205.201.134.128-205.201.134.255</host_ip>
                </ips>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>205.201.136.0-205.201.137.255</host_ip>
                </ips>
                <ips>
                    <is_trusted>1</is_trusted>
                    <create_time>2015-07-28 08:16:52</create_time>
                    <provider_id>7</provider_id>
                    <host_ip>205.201.139.0-205.201.139.255</host_ip>
                </ips>
            </cpanel>
        </providers>
        <providers_failed>
            <dpanel>Unknown mail provider: dpanel</dpanel>
        </providers_failed>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>cpgreylist_list_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 list entries for 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
providersarray of hashesAn array of the mail providers and their IP addresses.This hash includes one or more provider_key hashes. 

provider_key

hash

A hash of the mail provider's IP addresses.

Note:

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

The function returns this hash in the providers array.

This hash includes the ips hash.

 

ips

hash

A hash of the mail provider's IP address data.

The function returns this hash in the provider_key hash.

This hash includes the is_trusted, create_time, provider_id, and host_ip returns.

 

is_trusted

Boolean

Whether Greylisting trusts this mail provider's IP addresses.

The function returns this value in the ips hash.

  • 1 — Trusted.
  • 0 — Not trusted.
1

create_time

string

The date and time when the function created the record.

The function returns this value in the ips hash.

The date and time in YYYY-MM-DD HH:mm:SS format, where:

  • YYYY represents the year.
  • MM represents the month.
  • DD represents the date.
  • HH represents the hour.
  • mm represents the minute.
  • SS represents the second.
2015-07-28 08:16:52

provider_id

integer

The mail provider's identification number. 

The function returns this value in the ips hash.

A positive integer. 7 

host_ip

integer 

The mail provider's IP address or range.

The function returns this value in the ips hash.

A valid IP address or range. 192.168.0.1
providers_failedhashA hash of the mail providers for which the system failed to list IP addresses.This hash includes the provider_key return. 

provider_key

string

The reason why the system failed to list IP addresses for the provider.

Note:

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

The function returns this value in the providers_failed hash.

A valid string.Unknown mail provider.