SOLVED UAPI store_filter - specify minimum spam score

swbrains

Well-Known Member
Sep 13, 2006
304
44
178
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!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello @swbrains,

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'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.

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?
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.

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?
Yes, that's the correct syntax. "Not Delivered" uses a space, and "error_message" uses an underscore.

Thank you.