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

Description

This function modifies 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/save_configuration?email=user@example.com&from_addresses=sender1@test.com,sender2@test.com&queue_days=14&spam_score=2.5&enable_auto_whitelist=1&whitelist_by_association=1&from_name=User


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.
// Modify BoxTrapper configuration for user@example.com.
$save_configuration = $cpanel->uapi(
    'BoxTrapper', 'save_configuration',
    array(
        'email'          			=> 'user@example.com',
  		'from_addresses' 			=> 'sender1@test.com,sender2@test.com',
  		'queue_days'	 			=> '14',
		'spam_score'				=> '2.5',
  		'from_name'		 			=> 'User',			
  		'enable_auto_whitelist' 	=> '1',
		'whitelist_by_association'  => '1',
    )
);


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.
 
# Modify BoxTrapper configuration for user@example.com.
my $save_configuration = $cpliveapi->uapi(
    'BoxTrapper', 'save_configuration',
    {
        'email'          			=> 'user@example.com',
  		'from_addresses' 			=> 'sender1@test.com,sender2@test.com',
  		'queue_days'	 			=> '14',
		'spam_score'				=> '2.5',
  		'from_name'		 			=> 'User',			
  		'enable_auto_whitelist' 	=> '1',
		'whitelist_by_association'  => '1',
    }
);


Note:

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

 Command Line
uapi --user=username BoxTrapper save_configuration email=user@example.com spam_score=2.5 from_addresses=sender1@test.com,sender2@test.com queue_days=14 enable_auto_whitelist=1 whitelist_by_association=1 from_name=User


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": null,
    "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
from_addressesstring

Required

The email addresses that the system uses when it sends messages back to the original message senders.

A comma-separated list of email addresses.sender1@test.com,sender2@test.com
spam_scorenumeric

The account's Apache SpamAssassin™ threshold score.

This parameter defaults to the account's current configuration.

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

A numeric value that can contain decimals.2.5
queue_daysinteger

Required

The number of days to retain log files and queued messages.

A positive integer.

14
enable_auto_whitelistBoolean

Required

Whether to enable automatic whitelisting for the account.

  • 1 — Enable.
  • 0 — Disable.
1
whitelist_by_associationBoolean

Required

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.
1
from_namestring

The name of the person who owns the email account.

This parameter defaults to the account's current configuration.

Any valid string.User

Returns

This function only returns metadata.