Child pages
  • UAPI Functions - BoxTrapper::get_configuration
Skip to end of metadata
Go to start of metadata

Description

This function retrieves an account's BoxTrapper configuration.

Important:

When you disable the MailReceive role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples 


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/get_configuration?email=user@example.com


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
// Retrieve BoxTrapper configuration for user@example.com.
$get_configuration = $cpanel->uapi(
    'BoxTrapper', 'get_configuration',
    array(
        'email' => 'user@example.com',
    )
);


Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Retrieve BoxTrapper configuration for user@example.com.
my $get_configuration = $cpliveapi->uapi(
    'BoxTrapper', 'get_configuration',
    {
        'email' => 'user@example.com',
    }
);


Note:

For more information, read our Guide to the LiveAPI System.

 Command Line
uapi --user=username BoxTrapper get_configuration email=user@example.com


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{
    "data": {
        "from_addresses": "user@example.com,usertwo@example.com",
        "from_name": "The Machine Assistant",
        "queue_days": 15,
        "spam_score": -2.5,
        "enable_auto_whitelist": 1,
        "whitelist_by_association": 1
    },
    "errors": null,
    "messages": null,
    "metadata": {},
    "status": 1
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
email

string

Required

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.

A valid email address on the cPanel account.user@example.com

Returns

ReturnTypeDescriptionPossible valuesExample
from_addressesstring

The email addresses that send emails from the account.

A comma-separated list of email addresses.

user@example.com,user2@example.com

spam_scorenumeric

The account's Apache SpamAssassin™ threshold score.

For more information about Apache SpamAssassin threshold scores, read our Spam Filters documentation.

A numeric value that can contain decimals.2.5
queue_daysinteger

The number of days that the system retains log files and queued messages.

A positive integer.

14
auto_whitelist_enabledBooleanWhether whitelisting is enabled.
  • 1 — Enabled.
  • 0 — Disabled.
1
whitelist_by_associationBooleanWhether the system whitelisted the email addresses in a message's To and From sections, including carbon-copied (CC) recipients.
  • 1 — Whitelisted.
  • 0 — Not whitelisted.

1

from_namestring

The name of the person who owns the email account.

A valid string.User