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.

Create Mailman List with API?

Discussion in 'cPanel Developers' started by benwiggy, May 29, 2011.

  1. benwiggy

    benwiggy Member

    Joined:
    Jul 3, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Is this possible? I'm on a shared server so can't access the python scripts directly...

    (I looked in the API documentation but couldn't find a function to do this...)
     
  2. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
  3. benwiggy

    benwiggy Member

    Joined:
    Jul 3, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Thanks David, much appreciated.

    A follow on question - when creating a list there's a ton of configuration options - is the only way to set these using something like cURL?
     
  4. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hi Ben,

    The cPanel API only allows you to create the basic list (by passing the new list name, the domain it's associated with, and an administrative password). From that point on, any configuration/modification to the list's settings would have to be done in Mailman itself. I'm not aware of any remote API for Mailman (2.x) that's in the main produce branch, so I'd have to say the answer the short answer is yes, long answer:
    1) since there isn't a remote API for Mailman, you will need to map the relevant page URLs (for "manual" query)
    2) you will need to map the elements within those pages for their significate settings.
    3) you can use cURL or any other native/extension library or functions that allow making http(s) queries within the language you're using. (if it's PHP, then you have the cURL extension library or the native fopen functions with stream wrappers).

    Regards
    -DavidN

    PS. Apparently, Mailman 3.x has a REST API that addresses the need for this. It is still in development and will likely be awhile before it hits stable (the basic qualifier for inclusion in cPanel). So, unfortunately, you're stuck 'screen scraping' and programming against the UI (which is something that I always dislike), but it's the only choice. sorry.
     
  5. benwiggy

    benwiggy Member

    Joined:
    Jul 3, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Hi David,

    Thanks once again for the detailed answer - I'll develop a PHP class to automatically set list settings later this week. (for mailman 2.1.14)

    For anyone reading this at a later date - please PM me for the code.

    Best,
    Ben
     
Loading...

Share This Page