Membership Management PHP UI

Hi,
I'm attempting to re-create the "Membership Management" using PHP. More specifically, I want to be able to view, and modify all column data associated with each subscriber in the same way the default Mailman UI does (ex. Name, Email, MOD, Hide, Nomail, Ack, Not Metoo, NoDupes, Digest, Plain, Language)
The purpose of this request is that I'm working on a PHP based admin UI which has company's look and feel, limits exposure to select options, add a few custom features, and potentially allows management of multiple lists from a single UI.
Thanks in advance!
Best Regards, Peter Knowles TPN Solutions

On Mon, 2014-06-16 at 14:01 -0700, Peter Knowles wrote:
I'm attempting to re-create the "Membership Management" using PHP. More specifically, I want to be able to view, and modify all column data associated with each subscriber in the same way the default Mailman UI does (ex. Name, Email, MOD, Hide, Nomail, Ack, Not Metoo, NoDupes, Digest, Plain, Language)
The purpose of this request is that I'm working on a PHP based admin UI which has company's look and feel, limits exposure to select options, add a few custom features, and potentially allows management of multiple lists from a single UI.
I do a lot of PHP based system management from authenticated web UIs which I've written. The general approach I've taken has been to create a set of python scripts to do the actual work, and then call them as needed from my PHP script using exec() and making ample use of the &$output and &$return_var arguments. Mailman list administration has the advantage in this in that it's also written in python.
Make sure the user that your PHP script runs as is in the mailman group. You can make very good use of ~mailman/bin/withlist -r to do pretty much whatever you need to do.
-- Lindsay Haisley | "Everything works if you let it" FMP Computer Services | 512-259-1190 | --- The Roadie http://www.fmp.com |

On 06/16/2014 02:01 PM, Peter Knowles wrote:
Hi,
I'm attempting to re-create the "Membership Management" using PHP. More specifically, I want to be able to view, and modify all column data associated with each subscriber in the same way the default Mailman UI does (ex. Name, Email, MOD, Hide, Nomail, Ack, Not Metoo, NoDupes, Digest, Plain, Language)
Do you want to implement this capability with your own PHP pages or do you want your PHP pages to GET the admin/listname/members page, parse it and display the results in its own way, and POST changes back to the Mailman web UI?
I.e. do you want to work through the existing Mailman web UI or bypass it?
If you want to work through the existing UI, see the FAQ at <http://wiki.list.org/x/uIA9> which I'm sure will raise more questions.
If you want to bypass it, you'll probably need to implement some helper scripts (Python scripts using Mailman methods do do the work) to do the actual data retrieval and updates, and invoke those from your PHP pages.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Mark,
Preferably I'd like to transparently issue a command to Mailman backend script(s). That is, my PHP UI would make localized changes to queue (for scheduled changes) or directly via the "exec" (or similar) command (for real-time changes).
Essentially, we want to be in a position eventually to completely cripple the admin UI shipped with Mailman.
One of the problems that I face is, I'm not a Python developer, so if existing Mailman python scripts can manage the "read/write" functions in order to extract things and update things that'd be great.
*** I'm already familiar with the "config_list" script which my "audit" script uses to maintain user/global config options we do not allow our users to maintain themselves. (that is, technically a user can override a setting we maintain currently, but within minutes the settings are reverted via our automated audit process. ***
Best Regards, Peter Knowles TPN Solutions
Email: pknowles@tpnsolutions.com Phone: 604-229-0715 Skype: tpnsupport Website: http://www.tpnsolutions.com
On Mon, Jun 16, 2014 at 2:38 PM, Mark Sapiro <mark@msapiro.net> wrote:
On 06/16/2014 02:01 PM, Peter Knowles wrote:
Hi,
I'm attempting to re-create the "Membership Management" using PHP. More specifically, I want to be able to view, and modify all column data associated with each subscriber in the same way the default Mailman UI does (ex. Name, Email, MOD, Hide, Nomail, Ack, Not Metoo, NoDupes, Digest, Plain, Language)
Do you want to implement this capability with your own PHP pages or do you want your PHP pages to GET the admin/listname/members page, parse it and display the results in its own way, and POST changes back to the Mailman web UI?
I.e. do you want to work through the existing Mailman web UI or bypass it?
If you want to work through the existing UI, see the FAQ at <http://wiki.list.org/x/uIA9> which I'm sure will raise more questions.
If you want to bypass it, you'll probably need to implement some helper scripts (Python scripts using Mailman methods do do the work) to do the actual data retrieval and updates, and invoke those from your PHP pages.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-Users mailing list Mailman-Users@python.org https://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://wiki.list.org/x/AgA3 Security Policy: http://wiki.list.org/x/QIA9 Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: https://mail.python.org/mailman/options/mailman-users/pknowles%40tpnsolution...

Mark,
I'm also considering the use of the PEAR module Services_Mailman, which appears to interact with the Mailman default admin UI behind the scenes. This options may be feasible in the short term. Are you aware if this works with the current 2.x.x branch of Mailman without issue?
Best Regards, Peter Knowles TPN Solutions
Email: pknowles@tpnsolutions.com Phone: 604-229-0715 Skype: tpnsupport Website: http://www.tpnsolutions.com
On Mon, Jun 16, 2014 at 2:50 PM, Peter Knowles <pknowles@tpnsolutions.com> wrote:
Mark,
Preferably I'd like to transparently issue a command to Mailman backend script(s). That is, my PHP UI would make localized changes to queue (for scheduled changes) or directly via the "exec" (or similar) command (for real-time changes).
Essentially, we want to be in a position eventually to completely cripple the admin UI shipped with Mailman.
One of the problems that I face is, I'm not a Python developer, so if existing Mailman python scripts can manage the "read/write" functions in order to extract things and update things that'd be great.
*** I'm already familiar with the "config_list" script which my "audit" script uses to maintain user/global config options we do not allow our users to maintain themselves. (that is, technically a user can override a setting we maintain currently, but within minutes the settings are reverted via our automated audit process. ***
Best Regards, Peter Knowles TPN Solutions
Email: pknowles@tpnsolutions.com Phone: 604-229-0715 Skype: tpnsupport Website: http://www.tpnsolutions.com
On Mon, Jun 16, 2014 at 2:38 PM, Mark Sapiro <mark@msapiro.net> wrote:
On 06/16/2014 02:01 PM, Peter Knowles wrote:
Hi,
I'm attempting to re-create the "Membership Management" using PHP. More specifically, I want to be able to view, and modify all column data associated with each subscriber in the same way the default Mailman UI does (ex. Name, Email, MOD, Hide, Nomail, Ack, Not Metoo, NoDupes, Digest, Plain, Language)
Do you want to implement this capability with your own PHP pages or do you want your PHP pages to GET the admin/listname/members page, parse it and display the results in its own way, and POST changes back to the Mailman web UI?
I.e. do you want to work through the existing Mailman web UI or bypass it?
If you want to work through the existing UI, see the FAQ at <http://wiki.list.org/x/uIA9> which I'm sure will raise more questions.
If you want to bypass it, you'll probably need to implement some helper scripts (Python scripts using Mailman methods do do the work) to do the actual data retrieval and updates, and invoke those from your PHP pages.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-Users mailing list Mailman-Users@python.org https://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://wiki.list.org/x/AgA3 Security Policy: http://wiki.list.org/x/QIA9 Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: https://mail.python.org/mailman/options/mailman-users/pknowles%40tpnsolution...

On 06/16/2014 02:54 PM, Peter Knowles wrote:
Mark,
I'm also considering the use of the PEAR module Services_Mailman, which appears to interact with the Mailman default admin UI behind the scenes. This options may be feasible in the short term. Are you aware if this works with the current 2.x.x branch of Mailman without issue?
I'm not specifically aware of what does or doesn't work, but I've glanced at the docs and it doesn't seem to use anything that hasn't been stable for over a decade.
It does however appear to rely on the availability of the Membership Management... -> Membership List, Mass Subscription and Mass Removal pages for listing, subscribing and removing members and the user options page for setting user options.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On Mon, 2014-06-16 at 14:50 -0700, Peter Knowles wrote:
Mark,
Preferably I'd like to transparently issue a command to Mailman backend script(s). That is, my PHP UI would make localized changes to queue (for scheduled changes) or directly via the "exec" (or similar) command (for real-time changes).
The ~mailman/bin/export.py script outputs full list information in XML format. PHP has XML parsing capabilities which can probably pull the information you want from the output. Alternatively, running ~mailman/bin/dumpdb on the config.pck file for the list will provide you with much the same information, albeit parsing the information may be somewhat more difficult.
This gives you read capabilities. Write capabilities are another matter.
Essentially, we want to be in a position eventually to completely cripple the admin UI shipped with Mailman.
Might this also disallow the use of the Services_Mailman PEAR module?
One of the problems that I face is, I'm not a Python developer, so if existing Mailman python scripts can manage the "read/write" functions in order to extract things and update things that'd be great.
Peter, given the complexity of parsing the necessary information from the output of existing scripts, and the limited options with the existing scripts for inputting per-subscriber information, OR the complexity of interacting with the membership web-UI, any time you spend learning basic python scripting might well be a more effective use of your development efforts. Python is perhaps the most syntactically logical and easy to use of all the interpreted languages I've worked with, which includes a good number of them, and scripting of list membership management functions and I/O into a workable PHP-generated web UI would be almost trivial given decent PHP and related web development skills, once you have a basic understanding of the python code required to read and write the atoms of information which make up the subscriber database. It's not really all that complex, and you don't have to become a python expert to do it. If you understand PHP scripting and OO programming you're 2/3 of the way there.
I know that Mark is the go-to guy on all things having to do with Mailman code, but as far as integrating system administrative functions into a web UI, I've had a lot of experience on my own hosting service, so I'm not exactly shooting in the dark here. Been there, done that, bought the T-shirt :)
*** I'm already familiar with the "config_list" script which my "audit" script uses to maintain user/global config options we do not allow our users to maintain themselves. (that is, technically a user can override a setting we maintain currently, but within minutes the settings are reverted via our automated audit process. ***
config_list doesn't handle per_subscriber settings.
On Mon, Jun 16, 2014 at 2:38 PM, Mark Sapiro <mark@msapiro.net> wrote:
On 06/16/2014 02:01 PM, Peter Knowles wrote:
Hi,
I'm attempting to re-create the "Membership Management" using PHP. More specifically, I want to be able to view, and modify all column data associated with each subscriber in the same way the default Mailman UI does (ex. Name, Email, MOD, Hide, Nomail, Ack, Not Metoo, NoDupes, Digest, Plain, Language)
Do you want to implement this capability with your own PHP pages or do you want your PHP pages to GET the admin/listname/members page, parse it and display the results in its own way, and POST changes back to the Mailman web UI?
I.e. do you want to work through the existing Mailman web UI or bypass it?
If you want to work through the existing UI, see the FAQ at <http://wiki.list.org/x/uIA9> which I'm sure will raise more questions.
If you want to bypass it, you'll probably need to implement some helper scripts (Python scripts using Mailman methods do do the work) to do the actual data retrieval and updates, and invoke those from your PHP pages.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-Users mailing list Mailman-Users@python.org https://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://wiki.list.org/x/AgA3 Security Policy: http://wiki.list.org/x/QIA9 Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: https://mail.python.org/mailman/options/mailman-users/pknowles%40tpnsolution...
Mailman-Users mailing list Mailman-Users@python.org https://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://wiki.list.org/x/AgA3 Security Policy: http://wiki.list.org/x/QIA9 Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: https://mail.python.org/mailman/options/mailman-users/fmouse%40fmp.com
-- Lindsay Haisley | "Everything works if you let it" FMP Computer Services | 512-259-1190 | --- The Roadie http://www.fmp.com |

Lindsay,
I didn't mean to come off as completely ignoring your suggestions.
As for the temporary solution, yes this would require that the existing UI continue to be running in order to work, which as mentioned may be a "temporary" immediate solution while I work to gain the required knowledge.
You had mentioned something about "withlist" being the script which may can do pretty much everything. Could this script be used for "updating" subscriber settings, and if so could you give an example?
Best Regards, Peter Knowles TPN Solutions
Email: pknowles@tpnsolutions.com Phone: 604-229-0715 Skype: tpnsupport Website: http://www.tpnsolutions.com
On Mon, Jun 16, 2014 at 3:45 PM, Lindsay Haisley <fmouse@fmp.com> wrote:
On Mon, 2014-06-16 at 14:50 -0700, Peter Knowles wrote:
Mark,
Preferably I'd like to transparently issue a command to Mailman backend script(s). That is, my PHP UI would make localized changes to queue (for scheduled changes) or directly via the "exec" (or similar) command (for real-time changes).
The ~mailman/bin/export.py script outputs full list information in XML format. PHP has XML parsing capabilities which can probably pull the information you want from the output. Alternatively, running ~mailman/bin/dumpdb on the config.pck file for the list will provide you with much the same information, albeit parsing the information may be somewhat more difficult.
This gives you read capabilities. Write capabilities are another matter.
Essentially, we want to be in a position eventually to completely cripple the admin UI shipped with Mailman.
Might this also disallow the use of the Services_Mailman PEAR module?
One of the problems that I face is, I'm not a Python developer, so if existing Mailman python scripts can manage the "read/write" functions in order to extract things and update things that'd be great.
Peter, given the complexity of parsing the necessary information from the output of existing scripts, and the limited options with the existing scripts for inputting per-subscriber information, OR the complexity of interacting with the membership web-UI, any time you spend learning basic python scripting might well be a more effective use of your development efforts. Python is perhaps the most syntactically logical and easy to use of all the interpreted languages I've worked with, which includes a good number of them, and scripting of list membership management functions and I/O into a workable PHP-generated web UI would be almost trivial given decent PHP and related web development skills, once you have a basic understanding of the python code required to read and write the atoms of information which make up the subscriber database. It's not really all that complex, and you don't have to become a python expert to do it. If you understand PHP scripting and OO programming you're 2/3 of the way there.
I know that Mark is the go-to guy on all things having to do with Mailman code, but as far as integrating system administrative functions into a web UI, I've had a lot of experience on my own hosting service, so I'm not exactly shooting in the dark here. Been there, done that, bought the T-shirt :)
*** I'm already familiar with the "config_list" script which my "audit" script uses to maintain user/global config options we do not allow our users to maintain themselves. (that is, technically a user can override a setting we maintain currently, but within minutes the settings are reverted via our automated audit process. ***
config_list doesn't handle per_subscriber settings.
On Mon, Jun 16, 2014 at 2:38 PM, Mark Sapiro <mark@msapiro.net> wrote:
On 06/16/2014 02:01 PM, Peter Knowles wrote:
Hi,
I'm attempting to re-create the "Membership Management" using PHP. More specifically, I want to be able to view, and modify all column data associated with each subscriber in the same way the default Mailman UI does (ex. Name, Email, MOD, Hide, Nomail, Ack, Not Metoo, NoDupes, Digest, Plain, Language)
Do you want to implement this capability with your own PHP pages or do you want your PHP pages to GET the admin/listname/members page, parse it and display the results in its own way, and POST changes back to the Mailman web UI?
I.e. do you want to work through the existing Mailman web UI or bypass it?
If you want to work through the existing UI, see the FAQ at <http://wiki.list.org/x/uIA9> which I'm sure will raise more questions.
If you want to bypass it, you'll probably need to implement some helper scripts (Python scripts using Mailman methods do do the work) to do the actual data retrieval and updates, and invoke those from your PHP pages.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-Users mailing list Mailman-Users@python.org https://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://wiki.list.org/x/AgA3 Security Policy: http://wiki.list.org/x/QIA9 Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe:
https://mail.python.org/mailman/options/mailman-users/pknowles%40tpnsolution...
Mailman-Users mailing list Mailman-Users@python.org https://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://wiki.list.org/x/AgA3 Security Policy: http://wiki.list.org/x/QIA9 Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: https://mail.python.org/mailman/options/mailman-users/fmouse%40fmp.com
-- Lindsay Haisley | "Everything works if you let it" FMP Computer Services | 512-259-1190 | --- The Roadie http://www.fmp.com |
Mailman-Users mailing list Mailman-Users@python.org https://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://wiki.list.org/x/AgA3 Security Policy: http://wiki.list.org/x/QIA9 Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: https://mail.python.org/mailman/options/mailman-users/pknowles%40tpnsolution...

On 06/16/2014 03:54 PM, Peter Knowles wrote:
Lindsay, ...
You had mentioned something about "withlist" being the script which may can do pretty much everything. Could this script be used for "updating" subscriber settings, and if so could you give an example?
Actually, both withlist and config_list can do anything including irrevocably breaking your lists if you don't know what you're doing.
See <http://www.msapiro.net/scripts/> for some examples. These are all scripts, some withlist and some stand alone, for doing various Mailman tasks. They exist as a resource for people who want to use them as is, but mainly they exist as example of how to do things.
withlist is a framework for passing a list object or all lists objects sequentially to a script and taking care of a bit of housekeeping. Withlist can also be invoked as an interactive Python shell with access to a list object and Mailman's Python API.
config_list is normally just given some input like
attribute = value
to update list attributes, but it works by executing the input file as a Python script and then examining the returned namespace to see what was done. It also passes the list object to the execiting input, so the input can actually do any legal Python thing with that list object.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Peter Knowles writes:
I'm attempting to re-create the "Membership Management" using PHP. More specifically, I want to be able to view, and modify all column data associated with each subscriber in the same way the default Mailman UI does (ex. Name, Email, MOD, Hide, Nomail, Ack, Not Metoo, NoDupes, Digest, Plain, Language)
It shouldn't be hard to use the bin/list-members script as a skeleton and add any information from Mailman/MemberAdaptor.py that you in addition, and translate that to (eg) CSV output for use by your PHP scripts.
OTOH, you might want to just go directly to Mailman 3, which has a REST (over HTTP) interface for this information. AFAIK for your use case Mailman 3 is completely usable (what we're missing at the moment is well-integrated totally sweet archiving and admin interfaces, but you're obviously planning to provide the latter yourself and I bet you already have 90% of the former for the same reasons).
The place to discuss the MM3 option is mailman-developers@python.org, although several of us are here. The folks who develop the admin and archive interfaces are mostly not, and they may have interesting hints about glitches and gotchas in the APIs you'll need to use..
participants (4)
-
Lindsay Haisley
-
Mark Sapiro
-
Peter Knowles
-
Stephen J. Turnbull