benwiggy

Member
Jul 3, 2010
7
0
51
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...)
 

cPanelDavidN

Well-Known Member
Staff member
Dec 17, 2009
571
3
68
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.
 

benwiggy

Member
Jul 3, 2010
7
0
51
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