Child pages
  • UAPI Functions - SpamAssassin::get_user_preferences
Skip to end of metadata
Go to start of metadata

Description

This function lists the Apache SpamAssassin™ settings for the account.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/SpamAssassin/get_user_preferences


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.

// List the Apache SpamAssassin™ settings for the account.
$sa_settings = $cpanel->uapi(
    'SpamAssassin', 'get_user_preferences'
);


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.

# List the Apache SpamAssassin™ settings for the account.
my $sa_settings = $cpliveapi->uapi(
    'SpamAssassin', 'get_user_preferences'
);


Note:

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

 

 cPanel Template Toolkit
<!-- List the Apache SpamAssassin™ settings for the account. -->
[% execute('SpamAssassin', 'get_user_preferences', { }) %]
[% FOREACH q = data %]
     <p>
         [% q %]
     </p>
[% END %]


Note:

For more information, read our Guide to Template Toolkit documentation. 

 

 Command Line
uapi --user=username SpamAssassin get_user_preferences


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":{  
      "score":[  
         "ACT_NOW_CAPS 5.01"
      ],
      "required_score":[  
         "5.0"
      ],
      "whitelist_from":[  
         "username@example.com"
      ],
      "blacklist_from":[  
         "username@example.com"
      ]
   },
   "messages":null,
   "errors":null,
   "metadata":{  

   },
   "status":1
}


Note:

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

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
scorearray of strings

The symbolic test name and score.

The function returns this value in the score array.

A valid test name and score.

ACT_NOW_CAPS 1
required_scorearray of strings

The score to mark a message as spam. The system considers mail that matches this score to be spam.

The function returns this value in the required_score array.

A valid floating-point number.

5.0
whitelist_fromarray of strings

The email addresses on the whitelist.

The function returns this value in the whitelist_from array.

A valid email address.

username@example.com
blacklist_fromarray of strings

The email addresses on the blacklist.

The function returns this value in the blacklist_from array.

A valid email address.

username2@example.com

Note:

Additional customizations may appear in the returns. For more information, read the Apache SpamAssassin configuration file documentation.