Child pages
  • WHM API 1 Functions - rebuild_mail_sni_config
Skip to end of metadata
Go to start of metadata

 

Description

This function rebuilds the mail SNI configuration files.

Important:

  • You must run this function after you change the SNI status in the WHM API 1 enable_mail_sni or disable_mail_sni functions.
  • In cPanel & WHM version 60 and later, Mail SNI is always enabled.
    • Functions that enable Mail SNI succeed with a warning: Mail SNI is always enabled now.
    • Functions that disable Mail SNI fail and make no changes.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/rebuild_mail_sni_config?api.version=1&reload_dovecot=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/rebuild_mail_sni_config?api.version=1&reload_dovecot=1
 Command Line
whmapi1 rebuild_mail_sni_config reload_dovecot=1 


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
 {
    "data": {
        "success": 1,
        "configs_built": [
            "/etc/dovecot/sni.conf"
        ]
    },
    "metadata": {
        "version": 1,
        "reason": "OK",
        "result": "1",
        "command": "rebuild_mail_sni_config"
    }
}
 Output (XML)
 <result>
    <data>
        <success>1</success>
        <configs_built>/etc/dovecot/sni.conf</configs_built>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>rebuild_mail_sni_config</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
reload_dovecotBoolean

Whether to reload the Dovecot service after the system rebuilds the configuration files.

This parameter defaults to 0.

  • 1 — Reload Dovecot.
  • 0 — Do not reload Dovecot.
1

Returns

ReturnTypeDescriptionPossible valuesExample

success

BooleanWhether the system rebuilt the configuration files.
  • 1 — Configuration files rebuilt.
  • 0 — Configuration files not rebuilt.
1

configs_built

string

The configuration file that this function rebuilds.

Note:

The function only returns this value if you call it as the root user.

An absolute directory path.

/etc/dovecot/sni.conf

Note:

In cPanel & WHM version 58 and earlier, the system uses the /etc/mail_sni_map configuration file.