Child pages
  • UAPI Functions - EmailAuth::disable_dkim
Skip to end of metadata
Go to start of metadata

Description

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

Important:

When you disable the MailSend role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/EmailAuth/disable_dkim?domain=example.com&domain=anotherexample.com


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Remove a domain's DKIM records.
$poll = $cpanel->uapi(
    'EmailAuth', 'disable_dkim',
    array(
        'domain' => 'example.com',
		'domain' => 'anotherexample.com'
  )
);


Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Remove a domain's DKIM records.
my $poll = $cpliveapi->uapi(
    'EmailAuth', 'disable_dkim',
    {
        'domain' => 'example.com',
		'domain' => 'anotherexample.com'
  }
);


Note:

For more information, read our Guide to the LiveAPI System.

 cPanel Template Toolkit
<!-- Remove a domain's DKIM records. -->
[% data = execute('EmailAuth', 'disable_dkim', { 'domain' => 'example.com', 'domain' => 'anotherexample.com' } ) %]
[% FOREACH q = data.resultname %]
     <p>
         [% q %]
     </p>
[% END %]


Note:

For more information, read our Guide to Template Toolkit documentation. 

 Command Line
uapi --user=username EmailAuth disable_dkim domain=example.com domain=anotherexample.com


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{
   "apiversion": 3,
   "module": "EmailAuth",
   "func": "disable_dkim",
   "result": {
      "data": [
        {
            "domain": "example.com",
            "msg": "[REMOVE:TXT@default._domainkey:v=DKIM1; k=rsa; p=AAAAB3NzaC1yc2EAAAABIwAAAQEA5kSivOqhs0U9ZMN20nxFe27QZ3t0lT2zbH7OSXylKd1rjAjYXGnSXC9j2uaZlemHlptBKVziMJC86ha7Hcj6dVOVrDQ6vF4q34bOCjtKLphQ0IjBzVIvqILH9eLJdRaOrS34CmgmPaisrCk5wKVlakygvUfcj3HzaTKS6THyZDGx5shdTpa9lby8tpOD3JceV7ay4w8r0DipoKPC0OLpvS4EABEeMo9sx8zQEaKv03XygjNCCYtFvxlQQIRGlVoL7mPaHSaL3anI05RpNbm/PS+9BhZg+BqNjU4ofHBbfkXk5MiN6M7ieR4Sk5BquccboGF13U5slNgmCEekdt0amw;]",
            "status": 1
        },
		{
			"domain": "anotherexample.com",
			"msg": "[REMOVE:TXT@default._domainkey:v=DKIM1; k=rsa; p=AAAAB3NzaC1yc2EAAAABIwAAAQEA5kSivOqhs0U9ZMN20nxFe27QZ3t0lT2zbH7OSXylKd1rjAjYXGnSXC9j2uaZlemHlptBKVziMJC86ha7Hcj6dVOVrDQ6vF4q34bOCjtKLphQ0IjBzVIvqILH9eLJdRaOrS34CmgmPaisrCk5wKVlakygvUfcj3HzaTKS6THyZDGx5shdTpa9lby8tpOD3JceV7ay4w8r0DipoKPC0OLpvS4EABEeMo9sx8zQEaKv03XygjNCCYtFvxlQQIRGlVoL7mPaHSaL3anI05RpNbm/PS+9BhZg+BqNjU4ofHBbfkXk5MiN6M7ieR4Sk5BquccboGF13U5slNgmCEekdt0amw;]",
			"status": 1
		}
    ],
  "errors": null,
  "messages": null,
  "metadata": {
      "transformed": 1
          },
  "status": 1,
  "warnings": null
  }
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
domainstring

Required

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

Note:

To remove 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 removal of a domain's DKIM record on the DNS server.

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

                

domain

string

The domain for which the system removed the DKIM record.

This function returns this value in the data array.

A valid domain.

example.com

msg

string

Information about the removed DKIM record.

This function returns this value in the data array.

A valid string.

 Click to view...

[REMOVE:TXT@default._domainkey:v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiLMNOpQDw5nw4NP1RsWXlfmiMzByDfOT16QCZO\/xJtrPZKskZF8\/sU0zWGTqKUOErlyJfoJzMDUv3\/zzjGswc2nEmYqxxoQZaBkN4QaS6MvJQxysAr+sK8C248\/r9zMperQdhJedUVejtpFQHJwgqpHy1tQMxY37L7sQjdxmQ5WnQ1acXiwIDAQAB\\;]

status

Boolean

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

This function returns this value in the data array.

  • 1The system removed the domain's DKIM record.
  • 0 — The system did not remove the domain's DKIM record.

1