Description

This function rebuilds an email account's cache file.

Examples 




https://hostname.example.com:2087/cpsess##########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Email&cpanel_jsonapi_func=clearpopcache&username="user"



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Rebuild the cache file for user@example.com.
$rebuild_email_cache = $cpanel->api2(
    'Email', 'clearpopcache', 
    array(
        'username'        => 'user',
    ) 
);

 



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Rebuild the cache file for user@example.com.
my $rebuild_email_cache = $cpliveapi->api2(
    'Email', 'clearpopcache',
    { 
        'username'        => 'user',
    }
);

 




cpapi2 --user=username Email clearpopcache username=user


For more information and additional output options, read our Guide to cPanel API 2 documentation or run the cpapi2 --help command.  




{
  "cpanelresult": {
    "apiversion": 2,
    "func": "clearpopcache",
    "data": [
      {
        "status": 1
      }
    ],
    "event": {
      "result": 1
    },
    "module": "Email"
  }
}



Parameters

ParameterTypeDescriptionPossible valuesExample
usernamestring

Required

The email account's username.

An email account username.

For example, user to rebuild the cache file for user@example.com.

user

Returns

ReturnTypeDescriptionPossible valuesExample
statusBoolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1
reasonstring

A reason for failure.

This function only returns a reason value if it failed. 


A string that describes the error.

This is an error message.
resultBoolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1