cPanel WHM icon

cPanel WHM

Full cPanel WHM API — all 622 operations across Accounts, DNS, Mail, SSL, Backups, Databases and more

Actions262

Mail → Remove email account messages by mailbox GUID

AI-generated

Summary

Remove email messages from a specific mailbox identified by its globally unique identifier (GUID) within a given email account, using a Dovecot search query to specify which messages to delete.

Inputs

  • Account (required) — The name of the email account from which the messages will be removed.
  • Mailbox Guid (required) — The mailbox's globally unique identifier (GUID). This identifies the mailbox containing the messages to be expunged. Use the WHM API 1 get_mailbox_status function to locate the mailbox GUID.
  • Query (required) — A Dovecot search query string that selects which messages to remove from the mailbox. Refer to Dovecot's Search Query documentation for query syntax and options.

Output shape

a JSON object containing the WHM API response indicating the outcome of the expunge operation

The response includes details confirming deletion or error messages. There is no pagination; the response corresponds to the single expunge request.

Links

Discussion