Child pages
  • WHM API 1 Functions - list_pops_for

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

This function lists a cPanel account’s email accounts.

 To prevent falsified data or symlink exploitation, the function uses the specified cPanel account user, rather than root user, to read data from the user’s home directory. The system compares the collected data from the user’s home directory to a server-wide domains list. The comparison of the data validates whether you can trust the data.

Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone
Expand
titleJSON API
Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/json-api/list_pops_for?api.version=1&user=example
Expand
titleXML API
Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/xml-api/list_pops_for?api.version=1&user=example
Expand
titleCommand Line
Code Block
languagebash
whmapi1 list_pops_for user=example

Include Page
LIB:_WHMAPI1CLINote
LIB:_WHMAPI1CLINote

Expand
titleOutput (JSON)
Code Block
languagetext
linenumberstrue
 {
    "data": {
        "pops": [
            "example1@example.com",
            "example3@example.com",
            "example2@example.com"
        ]
    },
    "metadata": {
        "version": 1,
        "reason": "OK",
        "result": "1",
        "command": "list_pops_for"
    }
}
Expand
titleOutput (XML)
Code Block
languagetext
linenumberstrue
 <result>
    <data>
        <pops>example1@example.com</pops>
        <pops>example3@example.com</pops>
        <pops>example2@example.com</pops>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>list_pops_for</command>
    </metadata>
</result>

Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The cPanel account user for which to list all owned email accounts.

A cPanel account username.example

Returns

ReturnTypeDescriptionPossible valuesExample
pops arrayAn array of email accounts that the cPanel user owns.An array of email accounts.

example1@example.com