API2 Email::storefilter Question.

rezman

Well-Known Member
Feb 3, 2011
45
0
56
USA
cPanel Access Level
Root Administrator
I've got it working so I can add filters however if there are already some filters created for [email protected], the new filter is added to the bottom. Is it possible to bump it to the top via API call?

This is what I'm processing using PHP. Works fine.
Code:
$args = array(
    [account] => "[email protected]",
    [filtername] => "Whitelist",
    [part1] => "\$header_from:",
    [match1] => "matches",
    [val1] => ".*@domain\.net",
    [opt1] => "or",
    [action1] => "save",
    [dest1] => "/INBOX",
    [action2] => "finish",
    [dest2] => ""
)
$cp->api2_query( "CPUSER", "Email", "storefilter", $args );
 

vanessa

Well-Known Member
PartnerNOC
Sep 26, 2006
833
28
178
Virginia Beach, VA
cPanel Access Level
DataCenter Provider
As far as I know, you can't do this with an API call. The cPanel interface basically loads up the filters, allows you to reorder them, then rewrites the vfilters file based on that order. I'd imagine that if you want to duplicate this functionality you'd need to do the same. Perhaps you can also open a feature request for this and they might add it in.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,202
363
It's not possible to change the order through a parameter of the API function itself, but you could write that functionality yourself if necessary, as indicated in the previous post.

Thanks.