This function removes mail messages from a cPanel account.
Important:
When you disable the Receive Mail role, the system disables this function.
account required | string The email account's name. Example: account=user@example.com |
mailbox_guid required | string The mailbox's globally unique identifier (GUID). Note: To find the mailbox GUID, use the WHM API 1 - Example: mailbox_guid=2550860f0c58d158c92a000044f0d230 |
query required | string The Dovecot search query to select which messages you wish to remove from the mailbox. For more information, read Dovecot's Search Query documentation. Example: query=savedbefore 52w |
HTTP Request was successful.
object |
whmapi1 --output=jsonpretty \ expunge_messages_for_mailbox_guid \ account='user@example.com' \ mailbox_guid='2550860f0c58d158c92a000044f0d230' \ query='savedbefore 52w'
{- "metadata": {
- "command": "expunge_messages_for_mailbox_guid",
- "reason": "OK",
- "result": 1,
- "version": 1
}
}