Description
This function sets a default email archiving configuration.
Warning:
We strongly recommend that you use UAPI instead of cPanel API 2. However, no equivalent UAPI function exists.
Note:
This feature uses the GMT time zone to name directories, select messages to store in each directory, and timestamp messages. You cannot change this behavior.
Examples
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Warning:
Make certain that you use the correct parameters when you call this function. The function will not return errors if you pass invalid parameters, and will disable archiving types for which you do not specify a value.
Parameter |
Type |
Description |
Possible values |
Example |
incoming |
integer |
The retention period for incoming messages. This parameter defaults to to -1, which disablesarchiving. |
|
14 |
outgoing |
integer |
The retention period for outgoing messages. This parameter defaults to to -1 , which disablesarchiving. |
|
7 |
mailman |
integer |
The retention period formailing list messages. This parameter defaults to to -1 , which disablesarchiving. |
|
21 |
Returns
Return |
Type |
Description |
Possible values |
Example |
direction |
string |
The archiving type. |
|
outgoing |
statusmsg |
string |
A confirmation message. |
Note: In these examples, user is the account's cPanel username. |
Enabled the default archive configuration for \u201cuser\u201d. |
retention_period |
string |
The retention period. |
|
365 |
status |
boolean |
Whether the function succeeded. |
|
1 |
enabled |
boolean |
Whether archiving is enabled for this type. |
|
1 |
reason |
string |
A reason for failure. Note: This function only returns areasonvalue if it failed. |
A string that describes the error. |
This is an error message. |
result |
boolean |
Whether the function succeeded. |
|
1 |