Email
Email Accounts
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.
get/Email/browse_mailbox
Query parameters
accountstring email
Example:user@example.com
An email address, to limit the function's results.
dirstring
Example:maildir
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.
showdotfiles0 | 1
Whether to include hidden files and directories.
- 1 — Include hidden items.
- 0 — Do not include hidden items.
Response
HTTP Request was successful.
Example response
{
"apiversion": 3,
"func": "browse_mailbox",
"module": "Email",
"result": {
"data": [
{
"depth": 2,
"file": "archive",
"fullpath": "/home/example/mail/archive",
"mtime": 1413398866,
"path": "/home/example/mail",
"relpath": "/archive",
"type": "dir"
}
],
"metadata": {
"transformed": 1
},
"status": 1
}
}