We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.

We will continue to maintain our API documentation on this server.

Child pages
  • UAPI Functions - SSL::enable_mail_sni
Skip to end of metadata
Go to start of metadata

Description

This function enables SNI mail services on the specified domains.

Warning:

In cPanel & WHM version 60 and later, Mail SNI is always enabled.

  • Mail SNI is not compatible with Webmail and will not function for any Webmail connection. Webmail connections use the cPanel service SSL certificate.
  • Functions that enable Mail SNI succeed with a warning that Mail SNI is always enabled.
  • Functions that disable Mail SNI fail and make no changes.

Important:

In cPanel & WHM version 84 and later, when you disable the Calendars and Contacts, Receive Mail, Web DiskWebmail, and Web Server roles, the system disables this function.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/SSL/enable_mail_sni?domains=example.com%7Cexample1.com%7Cexample2.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.
 
// Enable SNI on example.com, example1.com, example2.com domains.
$enable_sni = $cpanel->uapi(
    'SSL', 'enable_mail_sni',
    array(
        'domains'     => 'example.com|example1.com|example2.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.
 
# Enable SNI on example.com, example1.com, example2.com domains.
my $enable_sni = $cpliveapi->uapi(
    'SSL', 'enable_mail_sni',
    {
        'domains'     => 'example.com|example1.com|example2.com',
    }
);


Note:

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

 Command Line
uapi --user=username SSL enable_mail_sni domains=example.com%7Cexample1.com%7Cexample2.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)
{
	"messages": null,
	"errors": null,
	"status": 1,
	"metadata": {

	},
	"data": {
		"updated_domains": {
			"example.com": 1,
			"example1.com": 1
		},

		"failed_domains": {
			"example2.com": 1
		}
	}
}


Note:

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

  Parameters

ParameterTypeDescriptionPossible valuesExample
domainsstring

Required

The account's domain or domains.

A pipe-delimited list of the account's domains.

example.com|example1.com|example2.com

Returns

Return

TypeDescriptionPossible valuesExample
failed_domainshashA hash of the domains that did not enable mail SNI.This hash includes the domain name return.

domain name

string

The reason the domain failed to enable mail SNI.

Note:

The domain name is the return name.

The function returns this value in the failed_domains hash.

A valid string.

Sorry, example.com is not one of the domains on your account.
updated_domainshash

A hash of the domains with disabled mail SNI.

This hash includes the domain name return.


domain name

Boolean

Whether the domain's SNI is enabled.

Note:

The domain name is the return name.

The function returns this value in the updated_domains hash.

  • 1 — Enabled.
  • 0 — Not enabled.
1