This function removes mail messages from a cPanel account that you select with a query.
Important:
When you disable the Receive Mail role, the system disables this function.
account required | string <email> An email account that exists on the server. Example: account=user@example.com |
mailbox required | string A mailbox name on the account. Note: Because you cannot escape wildcard characters such as ( Example: mailbox=INBOX |
query required | string A Dovecot search query to select which messages you wish to remove from the mailbox. Example: query=savedbefore 52w |
HTTP Request was successful.
object |
whmapi1 --output=jsonpretty \ expunge_mailbox_messages \ account='user@example.com' \ mailbox='INBOX' \ query='savedbefore 52w'
{- "metadata": {
- "command": "expunge_mailbox_messages",
- "reason": "OK",
- "result": 1,
- "version": 1
}
}