cPanel/Mailboxes
cPanel module

Mailboxes

5 functions, invoked through the cpanel_uapi tool.

scope cpanel:uapi
Call any function with cpanel_uapi(service_id, module="Mailboxes", function, params). Live availability depends on the cPanel features JetHost has enabled on your account — call list_cpanel_operations to see what is active.

expunge_mailbox_messages GET#

Delete selected messages in mailbox

This function marks the selected mail messages as deleted.

accountmixedRequired
The email account's name.
mailboxstringRequired
The mailbox to operate on. Note: Use the Mailboxes::get_mailbox_status_list function to list possible values for the mailbox parameter. Because you cannot escape wildcard characters such as (*), we recommend that you use functions that use the mailbox_guid parameter instead. For example, the Mailboxes::expunge_messages_for_mailbox_guid function.
querystringRequired
The Dovecot query to execute. Note: The query parameter prevents accidental removal of all messages in the mailbox. For more information, read Dovecot's Search Query documentation.

Response — normalized as { ok, data, errors[], warnings[] }; data contains:

Payload varies by call.

expunge_messages_for_mailbox_guid GET#

Delete selected messages in mailbox by GUID

This function marks the selected mailbox's messages as deleted.

accountmixedRequired
The email account's name.
mailbox_guidstringRequired
The mailbox's globally unique identifier (GUID). Use the Mailboxes::get_mailbox_status_list function to list possible values for the mailbox_guid parameter.
querystringRequired
The query to select which messages you wish to remove from the mailbox.

Response — normalized as { ok, data, errors[], warnings[] }; data contains:

Payload varies by call.

get_mailbox_status_list GET#

Return cPanel account's mailbox status

This function lists the account's mailbox size and globally unique identifier (GUID) by folder.

accountstringRequired
The email account for which you you wish to request the status.

Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:

guidstring
The mailbox GUID.
mailboxstring
The mailbox name.
messagesinteger
The number of messages in the folder.
vsizeinteger
The size of the folder, in bytes.

has_utf8_mailbox_names GET#

Return if cPanel account's mailboxes use UTF-8

This function determines whether a cPanel user currently uses UTF-8 character-encoded mailbox names.

userstringOptional
The user for whom to determine whether they currently use UTF-8 character-encoded mailbox names. Note: This parameter defaults to the currently-logged in user.

Response — normalized as { ok, data, errors[], warnings[] }; data contains:

enabledinteger
Whether the user currently uses UTF-8 character-encoded mailbox names. 1 - Uses UTF-8 character-encoded mailbox names. 0 - Does not use UTF-8 character-encoded mailbox names.
One of: 0 1

set_utf8_mailbox_names GET#

Enable or disable Webmail mailbox UTF-8 encoding

This function enables or disables UTF-8-encoded mailbox names on Roundcube webmail for a cPanel user's email accounts.

enabledintegerRequired
Whether to enable or disable UTF-8 character-encoded mailbox names. 1 - Enable UTF-8 encoded mailbox names. 0 - Disable UTF-8 encoded mailbox names.

Response — normalized as { ok, data, errors[], warnings[] }; data contains:

successinteger
Whether the system changed mailbox name setting's status. 1 - Success. 0 - Failure.
One of: 0 1