[Mailman-Developers] Interacting with mailman remotely through APIs / wrappers

Barry Warsaw barry at python.org
Fri May 18 23:58:30 CEST 2007

Hash: SHA1

On May 17, 2007, at 8:39 AM, Ben Sims wrote:

> With regards to Mailman 3, from my reading I understand that this  
> will implement SQL-type storage for all configuration and list  
> data. This would completely take care of my needs in this case I  
> think; would you perhaps be able to give us a rough idea of progress?

Things are moving along well.  My work these days has been to  
complete the data model using Elixir and SQLAlchemy.  I had a  
breakthrough with Elixir a few days ago, so now I'm just working on  
completing the model, related interfaces, and doctests.  My plan is  
to have a working database backend asap so I can unbreak all the  
higher level stuff that depends on the data model.  Right now I'm  
working in a branch, but I am going to very soon merge this back to  
the trunk, even though it will break the trunk. I speak more about  
this in some later postings.

I'm trying to be very diligent about writing interfaces to describe  
how Mailman interacts with the data model, so you could potentially  
back it with different storage mechanisms.  The idea is that you  
might want to put your list data in Mailman's default SQLite  
database, but you might want to get your user data out of your  
enterprise database.  By writing your own implementations of  
Mailman's interfaces, you should be able to do that.

> As a garden-variety PHP developer and Mailman rookie, I doubt how  
> far I am capable of going deep into Mailman itself to implement a  
> solution for this. I would be happy to do the research before  
> dismissing the idea though, if you could point me in the direction  
> of some bedtime reading on the subject. Given the time I have  
> available and the limited functionality required, I'm very much  
> leaning towards the cheapest hack option - which seems likely to be  
> simply executing command line commands.

I wonder if there isn't a cleaner way to integrate PHP and Python.   
Does anybody know?  Or is some form of IPC really the only way to go?

Writing command line interfaces to provide the functionality you want  
should not be difficult at all, if you are comfortable writing Python.

> Regarding your questions:
> -- What functionality do you want to expose?
> Not much. To start with, creating and removing lists and adding and  
> deleting subscribers would probably be enough.

Creating and removing lists are a bit hackish now because the logic  
to do so is spread out in a couple of places.  However see the bin/ 
newlist script or Mailman/Cgi/newlist.py module for examples.  The  
former may already do what you need here.  This will get much easier  
in MM3.

Likewise for adding and deleting subscribers.

> -- How would you handle security?
> To be honest, I hadn't even got as far as thinking about that,  
> since I'm not really clear on the mechanisms involved.
> - - Will you have to re-implement much of the CGI logic?
> Again, I haven't gone through closely enough to give a decent  
> answer. If I was hacking something up which did use the Web  
> Interface as a gateway, I would be more likely to use Mechanize to  
> fake a browser and do the intereacting. Ugly I know, but I'm  
> familiar with that so I could get it to work.

Probably much easier to use the existing command line scripts,  
augmenting or writing your own as needed.  Remember you can also do a  
lot with bin/withlist scripts.

- -Barry

Version: GnuPG v1.4.7 (Darwin)


More information about the Mailman-Developers mailing list