Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description


Excerpt

This function removes mail messages from a cPanel account that you select with a query.


Panel
bgColor#F2F2F2
borderStylenone

Examples


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleJSON API


Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/json-api/expunge_mailbox_messages?api.version=1&account=example&mailbox=INBOX&query=savedbefore%2052w



Expand
titleXML API


Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/xml-api/expunge_mailbox_messages?api.version=1&account=example&mailbox=INBOX&query=savedbefore%2052w



Expand
titleCommand Line


Code Block
languagebash
whmapi1 expunge_mailbox_messages account=example mailbox=INBOX query="savedbefore%2052w"

Include Page
LIB:_WHMAPI1CLINote
LIB:_WHMAPI1CLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{  
   "metadata":{  
      "reason":"OK",
      "command":"expunge_mailbox_messages",
      "version":1,
      "result":1
   },
   "data":{  

   }
}



Expand
titleOutput (XML)


Code Block
languagetext
linenumberstrue
<result>
    </data>
    <metadata>
        <reason>OK</reason>
        <version>1</version>
        <result>1</result>
        <command>expunge_mailbox_messages</command>
    </metadata>
</result>



Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote

     

Parameters

ParameterTypeDescriptionPossible valuesExample
accountstring

Required

The email account's name.

  • A valid email account that exists on the server.
  • The cPanel user's account name.

    Note
    titleNote:

    _mainaccount is an alias that represents the cPanel user's mailbox (For example, _mainaccount@example.com represents the example mailbox).


user@example.com

example

_mainaccount@example.com

mailboxstring

Required

The mailbox's name.

A valid mailbox name on the account.

Note
titleNote:

Because you cannot escape wildcard characters such as (*), we recommend that you use functions that use the mailbox_guid parameter instead. For example, the WHM API 1 expunge_messages_for_mailbox_guid function.


INBOX

querystring

Required

The query to select which messages you wish to remove from the mailbox.

A valid Dovecot search query

For more information, read Dovecot's Search Query documentation.

savedbefore 52w

Returns

This function only returns metadata.