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!

API2 Email::storefilter Question.

Discussion in 'cPanel Developers' started by rezman, Mar 17, 2014.

  1. rezman

    rezman Well-Known Member

    Joined:
    Feb 3, 2011
    Messages:
    45
    Likes Received:
    0
    Trophy Points:
    56
    Location:
    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 user@domain.net, 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] => "user@domain.net",
        [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 );
     
  2. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    830
    Likes Received:
    26
    Trophy Points:
    178
    Location:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,396
    Likes Received:
    1,857
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
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