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.

Max length for a cPanel session URL call?

Discussion in 'cPanel Developers' started by Svintaj, Jul 26, 2016.

Tags:
  1. Svintaj

    Svintaj Member

    Joined:
    Jul 22, 2016
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Stockholm - Sweden
    cPanel Access Level:
    Website Owner
    Hello, I am new to cPanel and session URL calls, and have a question:

    What is the [max length] or the recommended length for a "(UAPI) cPanel session URL call"-string? How many characters long can I make it without problems? I guess that my calls would fail if I don't take that in account.

    Thanks in advance!
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you provide an example of the type of URL you are attempting to use? What's making the length longer than expected?

    Thank you.
     
  3. Svintaj

    Svintaj Member

    Joined:
    Jul 22, 2016
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Stockholm - Sweden
    cPanel Access Level:
    Website Owner
    Yes of course. I am programmatically setting up Email filters, and the output string looks like this example, where I'm blocking three IP-adresses:
    Code:
    https://server.provider.com:2083/cpsessXXXXXXXXXX/execute/Email/store_filter?filtername=Test15&action1=fail "We identified your mail as SPAM."&match1=contains&part1=$message_headers&val1='333.333.333.333'&opt1=or&match2=contains&part2=$message_headers&val2='444.444.444.444'&opt2=or&match3=contains&part3=$message_headers&val3='555.555.555.555'&opt3=or
    But what if I like to block many more IPs say 50+?

    For each new IP to block I need to add this to the string:
    Code:
    &match4=contains&part4=$message_headers&val4='777.777.777.777'&opt4=or
    So my program need to know how many more IPs it can add to that string, and if it maybe need create another Email filter to make room for the remaining IPs.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    This is more of a limitation with the web browser from what I understand. There's a thread on StackOverflow where this topic is discussed:

    What is the maximum length of a URL in different browsers?

    Have you considered developing a custom script instead of utilizing a URL string?

    Thank you.
     
  5. Svintaj

    Svintaj Member

    Joined:
    Jul 22, 2016
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Stockholm - Sweden
    cPanel Access Level:
    Website Owner
    Ok thanks for the info and the informative link. So the safe limit for a URL string between browsers is about ~2000 chars, that's ok I can then block ~25 IPs per Email filter. I'm almost done now so I may be happy with this, even if it would have been nice to block more IPs per filter.

    However, am I even 'allowed' to run a Custom Script as an 'WebsiteOwner' I don't have a server myself? And if so how is it done? I know C, a bit C++ and some minor PHP. My program now is a Windows-application, where I just input a fresh cPanel-access code and a bunch of annoying"spam mails" and my app then builds the URL-string and 'runs' it in a browser to block them all.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  7. Svintaj

    Svintaj Member

    Joined:
    Jul 22, 2016
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Stockholm - Sweden
    cPanel Access Level:
    Website Owner
    Interesting, is there a good "hello world"-tutorial somewhere?
    I have really no idea from where I "run" a custom cPanel script, or where to save it?
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  9. Svintaj

    Svintaj Member

    Joined:
    Jul 22, 2016
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Stockholm - Sweden
    cPanel Access Level:
    Website Owner
    Thank you for all help, I'll take a look at it!
     

Share This Page