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 Dovecot query

AI-generated

Summary

Remove email messages from a specified mailbox in an email account on the server by applying a Dovecot search query to select the messages to delete.

Inputs

  • Account (required) — The email account existing on the server from which messages will be removed.
  • Mailbox (required) — The mailbox name within the specified account to target for message removal. Note that wildcard characters cannot be escaped, so using mailbox GUID-based functions is recommended for complex cases.
  • Query (required) — A Dovecot search query string that defines which messages to select and remove from the mailbox.

Output shape

An object containing the response from the WHM API call indicating the success or failure of the message removal operation.

The response data directly reflects the WHM API results related to expunging messages matching the Dovecot query in the specified mailbox and account. No pagination or multiple records are involved.

Links

Discussion