Skip to main content

Remote cPanel API calls via XMLAPI to access SpamAssassin

Comments

3 comments

  • cPanelMichael
    This gives me the white list and black list after some PHP processing. But I can't see how to get the CPANEL VARIABLES into a PHP variable.

    Hello, You may receive more user-feedback on this type a question a forum more suited to PHP development questions. The forum here is primarily intended for discussions about the cPanel API itself (e.g. how to obtain the data). Note that you may want to submit a feature request for the additional SpamAssassin functions for cPanel API2/UAPI: Submit A Feature Request Thank you.
    0
  • Kevin Hands
    I have managed to get the code working so that I can now read the SpamAssassin configuration. But I can't save the information back with the "SpamAsssain-saveconfig" API call. I pass the paremeters that it requires but all that happens is it reurns OK and the configuration in SpamAssassin is reset i.e. the black list and white lists are cleared and the score is set to 5. The parameters I am passing are- blacklist_from1-user@example.com 6 Spam_Rule 3 3 3 whitelist_from1-test@test.co.uk I am using curl to test the api. The curl data for the failing spamassassin api reads -"cpanel_xmlapi_user=test&cpanel_xmlapi_module=SpamAssassin&cpanel_xmlapi_func=saveconfig&cpanel_xmlapi_apiversion=1&arg-0=blacklist_from1-user@example.com&arg-1=6&arg-2=SPAM_RULE 3 3 3&arg-3=whitelist_from1-test@test.co.uk" I have tested my curl commands and I can successfully add an email account with the API function "Email-addpop" and parameters- user 12345luggage! 500 test.com NOTE - the domain name test.com is repacing my actual domain Thanks in advance
    0
  • cPanelMichael
    It's important to keep in mind that cPanel API 1 is deprecated. There's actually an internal case open to address the issue with the reset of the user_prefs file when new configuration values are added through the API (case number 48867). However, it's not likely this case will be addressed due to the deprecation of cPanel API 1. It's likely better to develop a custom script that directly modifies the configuration files, or to open a feature request for SpamAssassin API functionality. Thank you.
    0

Please sign in to leave a comment.