Mailbox

Each mailbox contains labels and messages.

Purge mailbox

Purges all deleted messages in the account older than the given date.

PUT /rest/v2/:domain/:user/mailbox/purge

Parameters

age
Optional date - Purge messages only older than the given age. If not specified, all messages in the queue will be purged. Date can be in any format in the current locale which is understood by the java.text.DateFormat.parse(String), for instance "2011/04/15" or "2011/05/01 14:30".

Response

Status: 204 No Content

Example request

% curl -XPUT "http://host:8181/rest/v2/domain.tld/user/mailbox/purge?age=2011%2F04%2F16"

Restore

Restore deleted messages.

Note: This method has not been implemented yet.

PUT /rest/v2/:domain/:user/mailbox/restore

Parameters

age
Optional date - Purge messages only older than the given age. If not specified, all messages in the queue will be purged. Date can be in any format in the current locale which is understood by the java.text.DateFormat.parse(String), for instance "2011/04/15" or "2011/05/01 14:30".

Response

Status: 204 No Content

Scrub counters

Mailbox size, number of total and new messages rely on counters implemented in the storage layer. With Cassandra (currently the only supported storage system) there are a number of scenarios when counters may start deviating from the real data.

Use this method to fix corrupted counters. It will read metadata for all messages in the mailbox, recalculate and update counters.

POST /rest/v2/:domain/:user/mailbox/scrub/counters

Response

Status: 204 No Content

Example request

% curl -XPOST "http://host:8181/rest/v2/domain.tld/user/mailbox/scrub/counters"

Scrub indexes

In case when label indexes became corrupted, it is possible to rebuild them from message metadata. This command will also recalculate and update counters similar to scrub counters method.

POST /rest/v2/:domain/:user/mailbox/scrub/indexes

Response

Status: 204 No Content

Example request

% curl -XPOST "http://host:8181/rest/v2/domain.tld/user/mailbox/scrub/indexes"