Return mail directory's subdirectories and files

This function lists the mail directory's subdirectories (boxes) and files.

Important:

When you disable the Receive Mail role, the system disables this function.

Notes:

If you do not use any input parameters, the function returns a list of items in the cPanel account's main mail directory.

SecurityBasicAuth
Request
query Parameters
account
string <email>

An email address, to limit the function's results.

Example: account=user@example.com
dir
string

A mail directory name, to limit results to specific directories.

Note:

If you pass the default or mail values, the function lists information for all mail directories.

Example: dir=maildir
showdotfiles
integer
Default: 0

Whether to include hidden files and directories.

  • 1 — Include hidden items.
  • 0 — Do not include hidden items.
Enum: 0 1
Example: showdotfiles=0
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/Email/browse_mailbox
Request samples
uapi --output=jsonpretty \
  --user=username \
  Email \
  browse_mailbox
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "browse_mailbox",
  • "module": "Email",
  • "result": {
    • "data": [
      • {
        • "depth": 2,
        • "file": "archive",
        • "fullpath": "/home/example/mail/archive",
        • "isleaf": 0,
        • "ismailbox": 0,
        • "mtime": 1413398866,
        • "path": "/home/example/mail",
        • "relpath": "/archive",
        • "type": "dir"
        }
      ],
    • "errors": null,
    • "messages": null,
    • "metadata": {
      • "transformed": 1
      },
    • "status": 1,
    • "warnings": null
    }
}