Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

UAPI store_filter - specify minimum spam score

Discussion in 'cPanel Developers' started by swbrains, Jul 13, 2018.

Tags:
  1. swbrains

    swbrains Well-Known Member

    Joined:
    Sep 13, 2006
    Messages:
    132
    Likes Received:
    16
    Trophy Points:
    168
    Hi,

    Using the UAPI function store_filter described here:
    UAPI Functions - Email::store_filter - Developer Documentation - cPanel Documentation
    does not mention a "part" parameter for spam score.

    However, in the old API Email::addfilter described here:
    cPanel API 1 Functions - Email::addfilter - Developer Documentation - cPanel Documentation
    it mentions the "part" parameter h_X-Spam-Score.

    I would like to create a new filter using the UAPI store_filter function that compares the spam score of a message to a specific value using a comparison part of the spam score, the match of "is above", and some value. Is this possible to do this using the UAPI function store_filter? What would be the "part" parameter for

    Also, I noticed in the second link to the old API it seems to refer the reader to a replacement function of Email::delete_filter. Is this correct or should it refer them to store_filter instead?

    Finally, is the "not delivered" part parameter correct in the UAPI doc? It shows "error_message" including an underscore where a space would normally be, but "not delivered" uses a space. Is this correct?

    Thanks!
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @swbrains,

    I've tested and confirmed the following values are usable with store_filter UAPI function's "Part*" parameter:

    Code:
    h_X-Spam-Status
    h_X-Spam-Score
    h_X-Spam-Bar
    I've opened internal case DOC-11185 with our Documentation Team to ensure these values are included on the document.

    It should link to the following cPanel API 2 and UAPI functions:

    UAPI Functions - Email::store_filter - Developer Documentation - cPanel Documentation
    cPanel API 2 Functions - Email::storefilter - Developer Documentation - cPanel Documentation

    I've opened internal case DOC-11184 with our Documentation Team to correct this.

    Yes, that's the correct syntax. "Not Delivered" uses a space, and "error_message" uses an underscore.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. swbrains

    swbrains Well-Known Member

    Joined:
    Sep 13, 2006
    Messages:
    132
    Likes Received:
    16
    Trophy Points:
    168
    Thanks!
     
    cPanelMichael likes this.
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice