Description

This function checks the installation status of Sender Policy Framework (SPF).

Examples 




https://hostname.example.com:2087/cpsess###########/json-api/cpanel?cpanel_jsonapi_user=username&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=SPFUI&cpanel_jsonapi_func=installed&user=username



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Check whether SPF is installed for example.com.
$check_installed_spf = $cpanel->api2(
    'SPFUI', 'installed', 
		array(
		'user'			=> 'username'
	 ) 
);

 



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Check whether SPF is installed for example.com.
my $install_spf = $cpliveapi->api2(
    'SPFUI', 'installed',
		{
		'user'			=> 'username'
		}
 );




cpapi2 --user=username SPFUI installed user=username



{
  "cpanelresult": {
    "apiversion": 2,
    "func": "installed",
    "data": [
      {
        "installed": 1,
        "active": 0
      }
    ],
    "event": {
      "result": 1
    },
    "module": "SPFUI"
  }
}



Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

The account's username.

If you do not specify a value, this parameter defaults to the currently authenticated username.

The cPanel account's username.
username

 

Returns

ReturnTypeDescriptionPossible valuesExample
installedBooleanWhether SPF is installed.
  • 1 — Installed.
  • 0 — Not installed.
1
activeBooleanWhether SPF is active.
  • 1 — Active.
  • 0 — Not active.
0
reasonstring

A reason for failure.

This function only returns a reason value if there was an error. 


 A string that describes the error. This is an error message.
resultBoolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1