The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    6
    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:
    817
    Likes Received:
    22
    Trophy Points:
    18
    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.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    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.
     
Loading...

Share This Page