25 functions, invoked through the cpanel_uapi tool.
scope cpanel:uapi
Call any function with cpanel_uapi(service_id, module="BoxTrapper", function, params). Live availability depends on the cPanel features JetHost has enabled on your account — call list_cpanel_operations to see what is active.
When you disable the Receive Mail role, the system disables this function.
emailstringRequired
The email address for which to blacklist messages. Warning: If you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated user.
queuefilestringRequired
The filename of the email message to blacklist.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
emailstring
The email address that sent the blacklisted message.
failedinteger
Whether the system failed to blacklist the message. Note: The function only returns this value if it doesn't blacklist the message.
One of: 1
matchesarray<string>
An array of messages that the system deleted.
operatorstring
The action that the function performed.
One of: blacklist
reasonstring
A message about the failure or the warning. Note: The function only returns this value if it doesn't delete the message or experiences issues when it deletes the message.
warninginteger
Whether the system experienced issues when it blacklisted the message. Note: The function only returns this value if it doesn't blacklist the message.
This function deletes messages in the BoxTrapper queue.
Important:
When you disable the Receive Mail role, the system disables this function.
emailstringRequired
The account's email address. Warning: If you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.
queuefilestringRequired
The filename of the email message who's sender to delete. Warning: To delete multiple email message senders, duplicate the parameter name.
all_likeintegerOptional
Whether to delete all messages that resemble the queuefile parameter's value. 1 - Delete all messages resembling the queuefile parameter. 0 - Do not delete all messages resembling the queuefile parameter.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
emailstring
The deleted email message's sender.
failedinteger
Whether the system failed to delete the messages. Note: The function only returns this value if it doesn't delete the message.
One of: 1
matchesarray<string>
An array of messages that the system deleted.
operatorstring
The operation that the system performed.
One of: delete
reasonstring
A message about the failure or the warning. Note: The function only returns this value if it doesn't delete the message or experiences issues when it deletes the message.
warninginteger
Whether the system experienced issues when it deleted the message. Note: The function only returns this value if it experiences issues when it deletes the message.
This function delivers messages in the BoxTrapper queue.
Important:
When you disable the Receive Mail role, the system disables this function.
emailstringRequired
The sender's cPanel account email address for which to deliver email messages. Warning: If you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.
queuefilestringRequired
The filename of the email messages to deliver. Note: To deliver multiple email messages, pass this parameter multiple times.
all_likeintegerOptional
Whether to deliver all messages that resemble the queuefile parameter's value. 1 - Deliver all similar messages. 0 - Don't deliver all similar messages.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
emailstring
The delivered email message's sender.
failedinteger
Whether the system could not deliver the message. Note: The function only returns this value if it doesn't deliver the message. 1 is the only possible value.
One of: 1
matchesarray<string>
A list of delivered email messages.
operatorstring
The action that the function performed. deliverdeliverall
One of: deliverdeliverall
reasonstring
A message about the failure or the warning. Note: The function only returns this value if it doesn't delete the message or experiences issues when it deletes the message.
warninginteger
Whether the system experienced issues when it delivered the message. Note: The function only returns this value if it experiences issues when it delivers the message. 1 is the only possible value.
This function retrieves a list of BoxTrapper allowlist configuration rules. BoxTrapper will deliver emails that match these rules.
Important:
When you disable the Receive Mail role, the system disables this function.
emailstringRequired
A valid email address on the cPanel account. Warning: If you call this function in Webmail, the system overrides this parameter. This parameter defaults to the current email address.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
This function retrieves a list of BoxTrapper blocklist configuration rules. BoxTrapper will delete messages that match these rules and send a notification to the sender.
Important:
When you disable the Receive Mail role, the system disables this function.
emailstringRequired
A valid email address on the cPanel account. Warning: If you call this function in Webmail, the system overrides this parameter. This parameter defaults to the current email address.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
This function retrieves an account's BoxTrapper configuration.
Important:
When you disable the Receive Mail role, the system disables this function.
emailstringRequired
The account's email address. Warning: If you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
enable_auto_whitelistinteger
Whether whitelisting is enabled. 1 - Enabled. 0 - Disabled.
One of: 01
from_addressesstring
The email addresses that send emails from the account. A comma-separated list of email addresses.
from_namestring
The name of the person who owns the email account.
queue_daysinteger
The number of days that the system retains log files and queued messages.
This function retrieves a BoxTrapper email message template.
Important:
When you disable the Receive Mail role, the system disables this function.
emailstringRequired
A valid email address on the cPanel account. Warning: If you call this function in Webmail, the system overrides this parameter. This parameter defaults to the current email address.
templatestringRequired
The message template. blacklistreturnverifyverifyreleasedverifyNote: For more information on each template, read our BoxTrapper documentation.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
This function retrieves a list of email addresses to which BoxTrapper forwards email messages.
Important:
When you disable the Receive Mail role, the system disables this function.
emailstringRequired
The account's email address. Important: If you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
The email addresses to which BoxTrapper forwards email.
This function retrieves a list of BoxTrapper ignorelist configuration rules. BoxTrapper will delete messages that match these rules without sending a notification to the sender.
Important:
When you disable the Receive Mail role, the system disables this function.
emailstringRequired
A valid email address on the cPanel account. Warning: If you call this function in Webmail, the system overrides this parameter. This parameter defaults to the current email address.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
This function returns the account's BoxTrapper log file and its contents.
Important:
When you disable the Receive Mail role, the system disables this function.
emailstringRequired
The account's email address. Important: If you call this function in Webmail, the system ignores this parameter and defaults to the currently authenticated email address.
dateintegerOptional
The date for which to return the log file and its contents. Note: This parameter defaults to the current date.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
dateinteger
The date for which the system returned the log.
linesarray<string>
An array of lines from the log file. If the log file doesn't exist or if no log lines exist in the file, the function returns an empty array.
pathstring
The log file's filepath. If the log file doesn't exist, the function returns an empty string.
Return message's top 200 lines in BoxTrapper queue
This function returns the first 200 lines of an email in the BoxTrapper queue.
Important:
When you disable the Receive Mail role, the system disables this function.
emailmixedRequired
The account’s name, either an email address or the cPanel user’s username. Important: If you call this function in Webmail, the system ignores this parameter.
queuefilestringRequired
The message's filename.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
contentstring
The email message's contents. Up to the first 200 lines of an email message.
This function marks email message senders for Exim to ignore.
Important:
When you disable the Receive Mail role, the system disables this function.
emailstringRequired
The cPanel email account from which to ignore messages. Warning: If you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.
queuefilestringRequired
The filename of the email message to ignore. Note: To ignore multiple email messages, duplicate this parameter.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
emailstring
The ignored email message's sender.
failedinteger
Whether the system failed to ignore the messages. 1 - Failed to ignore the message. 1 - Failed to ignore the message. 1 - Failed to ignore the message. 1 - Failed to ignore the message. * 1 - Failed to ignore the message. Note: The function only returns this value if it experiences issues when it ignores the message.
One of: 1
matchesarray<string>
An array containing ignored message files.
operatorstring
The operation that the system performed. * ignore — The system ignored this email message.
One of: ignore
reasonstring
A message that describes the failure or the warning. Note: The function only returns this value if it doesn't ignore the message or experiences issues when it ignores the message.
warninginteger
Whether the system experienced issues when it ignored the message. * 1 — The system encountered a problem. Note: The function only returns this value if it experiences issues when it ignores the message.
This function lists the BoxTrapper email templates.
Important:
When you disable the Receive Mail role, the system disables this function.
No parameters.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
An array of strings representing BoxTrapper message templates. blacklist - BoxTrapper responds with this message when a blacklisted address sends an email. verify - BoxTrapper responds with this message when an address that does not exist on the whitelist or blacklist sends an email. This message requests a response to confirm that the sender is legitimate. verifyreleased - BoxTrapper responds with this message when a person responds to the verify message with an email or a click on the verification link. returnverify - BoxTrapper responds with this message when the verification process fails.
This function returns a list of messages in the account's BoxTrapper queue.
Important:
When you disable the Receive Mail role, the system disables this function.
emailstringRequired
The email account for which to retrieve queued messages. Important: If you call this function in Webmail, the system ignores this parameter and defaults to the currently authenticated email address.
dateintegerOptional
The date for which to return queued messages.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
This function performs a specified action on messages in the BoxTrapper queue.
Important:
When you disable the Receive Mail role, the system disables this function.
actionstringRequired
The action to perform on the email message file. To perform multiple actions on the specified email messages, pass this parameter multiple times. deliver — Deliver a specific message. deliverall — Deliver all messages from a sender. delete — Delete a message. deleteall — Delete all messages from a sender. blacklist — Blacklist the sender of an email message. whitelist — Whitelist the sender of an email message. * ignore — Ignore email messages from a sender. Note: The function performs the actions on the email messages files in the order that you pass each action.
queuefilestringRequired
The filename of the email message to process. To process multiple email messages, pass this parameter multiple times.
emailstringOptional
The account's email address. Warning: The email parameter is required when this function is called outside of Webmail. If you call this function in Webmail, the email parameter is not required, and the system overrides this parameter with the current authenticated user's email address.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
emailstring
The email address for which the system processed an email message.
failedinteger
Whether the system failed to process the message. * 1 - The function failed to process the message. This is the only possible value. Note: The function only returns this value if it fails to process the message.
One of: 1
matchesarray<string>
An array of email messages that the system processed.
operatorstring
The operation that the system performed. deliver - Delivered a specific message. deliverall - Delivered all messages from a sender. delete - Deleted a message. deleteall - Deleted all messages from a sender. blacklist - Blacklisted the sender of an email message. whitelist - Whitelisted the sender of an email message. * ignore - Ignored email messages from a sender. Note: The function only returns this value if it successfully processes the message.
One of: deliverdeliveralldeletedeleteallblacklistwhitelistignore
reasonstring
A message about the failure or the warning. Note: The function only returns this value if it fails to processes the message or experiences issues when it processes the message.
This function restores the BoxTrapper email message templates to the system default setting.
Important:
When you disable the Receive Mail role, the system disables this function.
templatestringRequired
The message template. Possible values: blacklist - BoxTrapper responds with this message when a blacklisted address sends an email. verify - BoxTrapper responds with this message when an address that does not exist on the whitelist or blacklist sends an email. This message requests a response to confirm that the sender is legitimate. verifyreleased - BoxTrapper responds with this message when a person responds to the verify message with an email or a click on the verification link. returnverify - BoxTrapper responds with this message when the verification process fails.
emailstringOptional
The account's email address. Warning: The email parameter is required when this function is called outside of webmail. If you call this function in Webmail, the email parameter is not required, and the system overrides this parameter with the current authenticated user's email address.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
This function modifies an account's BoxTrapper configuration.
Important:
When you disable the Receive Mail role, the system disables this function.
emailstringRequired
The account's email address. Warning: If you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.
enable_auto_whitelistintegerRequired
Whether to enable automatic whitelisting for the account. 1 - Enable. 0 - Disable.
from_addressesstringRequired
A comma-separated list of email addresses that the system uses when it sends messages back to the original message senders.
queue_daysintegerRequired
The number of days to retain log files and queued messages.
whitelist_by_associationintegerRequired
Whether to whitelist the email addresses in a message's To and From sections, including carbon-copied (CC) recipients. 1 - Whitelist. 0 - Do not whitelist.
from_namestringOptional
The name of the person who owns the email account.
spam_scorenumberOptional
The account's Apache SpamAssassin™ threshold score. For more information about Apache SpamAssassin threshold scores, read our Spam Filters documentation. Note: This parameter defaults to the account's current configuration.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
This function saves the contents of a BoxTrapper message template.
Important:
When you disable the _Receive Mail_ role, the system disables this function.
contentsstringRequired
The template file's contents. You can use variables in the template to include details about the original message. Important: You must include To: %email% in this parameter's value. If you use the verify template, you must include Subject: verify#%msgid% in this parameter's value. This value cannot exceed four kilobytes (KB). You must URI-encode this parameter's value when using the CLI.
emailstringRequired
The account's email address. Warning: If you call this function in Webmail, the system overrides this parameter. Note: This parameter defaults to the current email address.
templatestringRequired
The message template. blacklistreturnverifyverifyreleasedverifyImportant: If you use the verify template, you must include Subject: verify#%msgid% in this parameter's value. Note: For more information about each template, read our BoxTrapper documentation.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
This function sets the BoxTrapper allowlist configuration rules. BoxTrapper will deliver emails that match these rules.
Important:
When you disable the Receive Mail role, the system disables this function.
emailstringRequired
A valid email address on the cPanel account. Warning: If you call this function in Webmail, the system overrides this parameter. This parameter defaults to the current email address.
rulesarray<any>Required
An array of allowlist rules. Note: You can set multiple allowlist rules, duplicate or increment the parameter name. For example, rules-1, rules-2, and rules-3.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
This function sets the BoxTrapper blocklist configuration rules. BoxTrapper will delete messages that match these rules and send a notification to the sender.
Important:
When you disable the Receive Mail role, the system disables this function.
emailstringRequired
A valid email address on the cPanel account. Warning: If you call this function in Webmail, the system overrides this parameter. This parameter defaults to the current email address.
rulesarray<any>Required
An array of blocklist rules. Note: You can set multiple block rules, duplicate or increment the parameter name. For example, rules-1, rules-2, and rules-3.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
This function adds a list of email addresses to which BoxTrapper forwards email messages.
Important:
When you disable the Receive Mail role, the system disables this function.
emailstringRequired
The account's email address. Warning: If you call this function in Webmail, the system ignores this parameter and uses the currently-authenticated email address.
forwarderarray<any>Required
The email addresses to which to forward email messages.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
This function sets the BoxTrapper ignorelist configuration rules. BoxTrapper will delete messages that match these rules without sending a notification to the sender.
Important:
When you disable the Receive Mail role, the system disables this function.
emailstringRequired
A valid email address on the cPanel account. Warning: If you call this function in Webmail, the system overrides this parameter. This parameter defaults to the current email address.
rulesarray<any>Required
An array of ignorelist rules. Note: You can set multiple ignore rules, duplicate or increment the parameter name. For example, rules-1, rules-2, and rules-3.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
This function enables or disables BoxTrapper for an email account.
Important:
When you disable the Receive Mail role, the system disables this function.
emailmixedRequired
The account's name. This can be an email address or the cPanel user’s username. Warning: If you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.
enabledintegerRequired
Whether to enable or disable BoxTrapper for the email account. 1 - Enable BoxTrapper. 0 - Disable BoxTrapper.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
When you disable the Receive Mail role, the system disables this function.
Note:
To retrieve email messages in the BoxTrapper queue from senders that you did not previously whitelist, use the UAPI BoxTrapper::deliver_messages function.
queuefilestringRequired
The filename of the email message to whitelist. Note: To get a list of filenames in an account's BoxTrapper queue, use the UAPI BoxTrapper::list_queued_messages function. Note: To whitelist multiple email messages, duplicate this parameter.
emailstringOptional
The cPanel account email address for which to whitelist messages. Warning If you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
emailstring
A whitelisted email address.
failedstring
The system failed to whitelist the message. * 1 — The function failed to whitelist the message. This is the only possible value. Note: The function only returns this property if it failed to whitelist the message.
One of: 1
matchesarray<string>
An array of message files that the system whitelisted. Note: The function only returns this value if it whitelists the message.
operatorstring
The action that the system performed.
One of: whitelist
reasonstring
The reason the function skipped the message during whitelisting. The reason property is returned only if the function failed to whitelist the message.
warninginteger
Whether the system experienced issues when it whitelisted the message. * 1 — There was an issue whitelisting the message. This is the only possible value. Note: The function only returns this property if it failed to whitelist the message.