Description

This function enables Domain Keys Identified Mail (DKIM) records on the DNS server for one or more domains.

Examples




https://hostname.example.com:2083/cpsess##########/execute/EmailAuth/enable_dkim?domain=example.com&domain=anotherexample.com



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Enable a DKIM record for a domain.
$poll = $cpanel->uapi(
    'EmailAuth', 'enable_dkim',
    array(
        'domain' => 'example.com',
		'domain' => 'anotherexample.com'
  )
);



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Enable a DKIM record for a domain.
my $poll = $cpliveapi->uapi(
    'EmailAuth', 'enable_dkim',
    {
        'domain' => 'example.com'
		'domain' => 'anotherexample.com'
  }
);



<!-- Enable a DKIM record for a domain. -->
[% data = execute('EmailAuth', 'enable_dkim', { 'domain' => 'example.com', 'domain' => 'anotherexample.com' } ) %]
[% FOREACH q = data.enable_dkim %]
     <p>
         [% q %]
     </p>
[% END %]



uapi --user=username EmailAuth enable_dkim domain=example.com domain=anotherexample.com



{
   "apiversion": 3,
   "module": "EmailAuth",
   "func": "enable_dkim",
   "result": {
      "data": [
        {
            "domain": "example.com",
            "msg": "Installed Keys",
            "status": 1
        },
		{
			"domain": "anotherexample.com",
			"msg": "[no changes needed]",
			"status": 1
		}
    ],
  "errors": null,
  "messages": null,
  "metadata": {
      "transformed": 1
          },
  "status": 1,
  "warnings": null
  }
}



Parameters

ParameterTypeDescriptionPossible valuesExample
domainstring

Required

The domain for which to enable DKIM records on the DNS server.

To enable multiple domain DKIM records, duplicate the parameter name. For example, use the domain=example.com, domain=example2.com, and domain=example3.com parameters.


A valid domain.example.com

Returns

ReturnTypeDescriptionPossible valuesExample
dataarray of hashes

An array that contains information about the enabled state of a domain's DKIM records on the DNS server.

Each hash contains the domain, msg, and status returns.

                

domain

string

The domain for which the system enabled the DKIM record.

This function returns this value in the data array.

A valid domain.

example.com

msg

string

The domain's DKIM record status message.

This function returns this value in the data array.

A valid string.Installed Keys

status

Boolean

Whether the system enabled the domain's DKIM record on the DNS server.

This function returns this value in the data array.

  • 1The system enabled the domain's DKIM record.
  • 0 — The system did not enable the domain's DKIM record.
1