Description
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 any input parameters, 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. |
A valid email address on the cPanel account. |
user@example.com |
dir |
string |
A mail directory name, to limit results to specific directories. |
A valid directory on the cPanel account. Note: If you pass the default or mail values, 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 absolute path to the item's home directory. |
/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 directory path to the item, relative to the mail directory. |
/archive |
ismailbox |
Boolean |
Whether the item is a mailbox. |
|
0 |
fullpath |
string |
The item's absolute path. |
The absolute path to the item. |
/home/example/mail/archive |
type |
string |
The item type. |
|
dir |