Description
This function retrieves a list of the mail directory's subdirectories (boxes) and files.
Warning:
We strongly recommend that you use the following UAPI function instead of this function:
-
Email::browse_mailbox
— This function lists the mail directory's subdirectories (boxes) and files.
Examples
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Note:
If you do not use a parameter, the function returns a list of items in the cPanel account's main mail directory.
Parameter |
Type |
Description |
Possible values |
Example |
account |
string |
An email address, to limit the function's results. If you do not include this parameter, the function returns data for all of the cPanel account's email addresses. |
A valid email address on the cPanel account. |
user@example.com |
dir |
string |
A mail directory name, to limit results to specific directories. If you do not include this parameter, the function returns data for all directories. |
A valid directory on the cPanel account. Note: If you pass default ormail, the function lists information for all mail directories. |
maildir |
showdotfiles |
Boolean |
Whether to include hidden files and directories. This value defaults to 0. |
|
0 |
Returns
Return |
Type |
Description |
Possible values |
Example |
mtime |
string |
The item's modification time. |
A time in Unix time format. |
1413398866 |
isleaf |
Boolean |
Whether the item is a file or a directory. |
|
0 |
file |
string |
The item's base name. |
A valid file or directory name. |
archive |
path |
string |
The item's directory's path. |
The item's directory's absolute path. |
/home/example/mail |
depth |
integer |
The directory depth of the item's path. |
A positive integer. |
2 |
relpath |
string |
The item's relative path. |
The item's relative path, from the mail directory. |
/archive |
ismailbox |
Boolean |
Whether the item is a mailbox. |
|
0 |
fullpath |
string |
The item's full path. |
The item's absolute path. |
/home/example/mail/archive |
type |
string |
The item type. |
|
dir |
reason |
string |
A reason for failure. Note: This function only returns a reason value if it failed. |
A string that describes the error. |
This is an error message. |
result |
Boolean |
Whether the function succeeded. |
|
1 |