Description

This function enables or disables DKIM.

Examples 


https://hostname.example.com:2087/cpsess##########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Email&cpanel_jsonapi_func=set_email_signing&dkim=1

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Enable DKIM on the cPanel account.
$enable_dkim = $cpanel->api2(
    'Email', 'set_email_signing', 
    array(
        'dkim'            => '1',
    ) 
);

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Enable DKIM on the cPanel account.
my $enable_dkim = $cpliveapi->api2(
    'Email', 'set_email_signing',
    {
        'dkim'            => '1',
    } 
);

 

cpapi2 --user=username Email set_email_signing dkim=1

{
  "cpanelresult": {
    "apiversion": 2,
    "func": "set_email_signing",
    "data": [
      1,
      "DKIM signing enabled"
    ],
    "event": {
      "result": 1
    },
    "module": "Email"
  }
}

Parameters

ParameterTypeDescriptionPossible valuesExample
dkimBoolean

Required

The new DKIM setting.

  • 1, y, yes, or on — Enable DKIM.
  • 0, n, no, or off — Disable DKIM.
1

Returns

ReturnTypeDescriptionPossible valuesExample
[0]BooleanWhether DKIM is enabled for the cPanel account.
  • 1 — Enabled.
  • 0 — Disabled.
1
[1]stringA message of success or a reason for failure.
  • DKIM signing enabled — DKIM is now enabled.
  • DKIM signing disabled — DKIM is now disabled.
  • An error message.
DKIM signing enabled
reasonstring

A reason for failure.

This function only returns a reason value if it failed. 

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