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

 

Description

This function modifies the server's Greylisting configuration settings.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/save_cpgreylist_config?api.version=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/save_cpgreylist_config?api.version=1
 Command Line
whmapi1 save_cpgreylist_config


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": {
    "cpgreylist_config": {
      "is_enabled": "1",
      "spf_bypass": "1",
      "child_timeout_secs": "5",
      "record_exp_time_mins": "4320",
      "is_exim_enabled": 1,
      "initial_block_time_mins": "10",
      "max_child_procs": "5",
      "purge_interval_mins": "60",
      "must_try_time_mins": "240"
    }
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "save_cpgreylist_config"
  }
}
 Output (XML)
<result>
    <data>
        <cpgreylist_config>
            <is_enabled>1</is_enabled>
            <spf_bypass>1</spf_bypass>
            <child_timeout_secs>5</child_timeout_secs>
            <record_exp_time_mins>4320</record_exp_time_mins>
            <is_exim_enabled>1</is_exim_enabled>
            <initial_block_time_mins>10</initial_block_time_mins>
            <max_child_procs>5</max_child_procs>
            <purge_interval_mins>60</purge_interval_mins>
            <must_try_time_mins>240</must_try_time_mins>
        </cpgreylist_config>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>save_cpgreylist_config</command>
    </metadata>
</result>




Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
spf_bypassBoolean

Whether emails with SPF bypass Greylisting.

Note:

You must include at least one of the following parameters: spf_bypass, child_timeout_secs, record_exp_time_mins, initial_block_time_mins, max_child_procs, purge_interval_mins, or must_try_time_mins.

  • 1 — Enabled.
  • 0 — Disabled.
1
child_timeout_secsinteger

The maximum amount of time in seconds that Greylisting waits for a child process to timeout.

Notes:

  • This parameter affects the function of the cPGreyList daemon. Do not change this value unless it is absolutely necessary.
  • You must include at least one of the following parameters: spf_bypass, child_timeout_secs, record_exp_time_mins, initial_block_time_mins, max_child_procs, purge_interval_mins, or must_try_time_mins.
A valid integer.5
record_exp_time_minsinteger

The number of minutes before Greylisting deletes the triplet record and treats a resent email as coming from a new, unknown triplet.

Note:

You must include at least one of the following parameters: spf_bypass, child_timeout_secs, record_exp_time_mins, initial_block_time_mins, max_child_procs, purge_interval_mins, or must_try_time_mins.


A valid integer.

The maximum value for this parameter is 43200 minutes (30 days).

4320
initial_block_time_minsinteger

The number of minutes during which Greylisting defers email from an unknown triplet.

Note:

You must include at least one of the following parameters: spf_bypass, child_timeout_secs, record_exp_time_mins, initial_block_time_mins, max_child_procs, purge_interval_mins, or must_try_time_mins.


A valid integer.

The maximum value for this parameter is 240 minutes (four hours).

10
max_child_procsinteger

The maximum number of child processes.

Notes:

  • This parameter affects the function of the cPGreyList daemon. Do not change this value unless it is absolutely necessary.
  • You must include at least one of the following parameters: spf_bypass, child_timeout_secs, record_exp_time_mins, initial_block_time_mins, max_child_procs, purge_interval_mins, or must_try_time_mins.


A valid integer.5
purge_interval_minsinteger

The number of minutes before Greylisting deletes the records in the Greylisting database.

Notes:

  • This parameter affects the function of the cPGreyList daemon. Do not change this value unless it is absolutely necessary.
  • You must include at least one of the following parameters: spf_bypass, child_timeout_secs, record_exp_time_mins, initial_block_time_mins, max_child_procs, purge_interval_mins, or must_try_time_mins.


A valid integer.60
must_try_time_minsinteger

The number of minutes during which Greylisting accepts a resent email from an unknown triplet.

Note:

You must include at least one of the following parameters: spf_bypass, child_timeout_secs, record_exp_time_mins, initial_block_time_mins, max_child_procs, purge_interval_mins, or must_try_time_mins.


A valid integer.

The maximum value for this parameter is 1440 minutes (one day).

240

Returns

Return

TypeDescriptionPossible valuesExample
cpgreylist_confighashA hash of Greylisting settings.This hash includes the is_enabled, spf_bypass, child_timeout_secs, record_exp_time_mins, is_exim_enabled, initial_block_time_mins, purge_interval_mins, max_child_procs, and must_try_time_mins returns. 

is_enabled

Boolean

Whether Greylisting is enabled.

The function returns this value in the cpgreylist_config hash.

  • 1 — Enabled.
  • 0 — Disabled.
1

spf_bypass

Boolean

Whether emails with SPF bypass Greylisting.

The function returns this value in the cpgreylist_config hash.

  • 1 — Bypass.
  • 0 — Do not bypass.
1

child_timeout_secs

integer

The maximum amount of time that Greylisting waits for child process to time out.

The function returns this value in the cpgreylist_config hash.

A valid integer, in seconds.5

record_exp_time_mins

integer

The number of minutes before Greylisting deletes the triplet record and treats a resent email as a new, unknown triplet.

The function returns this value in the cpgreylist_config hash.

A valid integer, in minutes.

The maximum value for this parameter is 43200 minutes (30 days).

4320

is_exim_enabled

Boolean

Whether Exim is enabled.

The function returns this value in the cpgreylist_config hash.

  • 1 — Enabled.
  • 0 — Disabled.
1

initial_block_time_mins

integer

The number of minutes during which Greylisting defers email from an unknown triplet.

The function returns this value in the cpgreylist_config hash.

A valid integer, in minutes.

The maximum value for this parameter is 240 minutes (four hours).

10

max_child_procs

integer

The maximum amount of child processes.

The function returns this value in the cpgreylist_config hash.

A valid positive integer.5

purge_interval_mins

integer

The number of minutes before Greylisting deletes the records in the Greylisting database.

The function returns this value in the cpgreylist_config hash.

A valid integer, in minutes.60

must_try_time_mins

integer

The number of minutes during which Greylisting accepts a resent email from an unknown triplet.

The function returns this value in the cpgreylist_config hash.

A valid integer, in minutes.

The maximum value for this parameter is 1440 minutes (one day).

240