Python remote urllib.request -> mailman subscription

Hey list,
I'd just like to preface my post with the acknowledgement that I had already posted the same query on Mailman-Users last week, but no one seemed to have an answer at the time. I figured it might be better to ask the developers.
My Python 3 / PyGI / Gtk+ application, among other things, prompts a user for their name, email, and password, and then submits an http POST request to a hard coded remote GNU Mailman server. So far, the code appears to work and I'll request a peer review by anyone kind enough:
One potential concern I've found is that it is difficult to machine parse the server response to reliably distinguish a successful subscription from a failure. A successful subscription returns an http code 200, but so do many failed ones (e.g. bad formatted email address is still code 200).
The most reliable brute force method I could come up with was to check the message body of the returned HTML document for the substring "Your subscription request has been received". Great, except since Mailman is i18n capable, its gettext could return something semantically equivalent, but obviously worded different if the locale is changed.
However, since the server I am submitting the request to will probably always use the English user interface, this probably won't be an issue, but is still inelegant and I'd like to solve it. Moreover, even if it remains in English, but perhaps the string changes anyways when Mailman is upgraded, then it is a problem again.
Does anyone have any suggestions or other feedback they'd like to share or propose a better solution?
-- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com

Kip Warner writes:
Does anyone have any suggestions or other feedback they'd like to share or propose a better solution?
The better solution is Mailman 3, which provides a REST API for programmatic administration, but it not going to be considered ready for production use (at least, not unless the admin is a Mailman 3 developer) for several months.
The only developer currently working on Mailman 2 at all is Mark Sapiro, who handles maintenance (ie, bug fixes and integration of "uncontroversial" minor feature patches). I think any change here is likely to be controversial, so won't make it to Mailman 2 in the near future.

On Mon, 2013-05-27 at 12:44 +0900, Stephen J. Turnbull wrote:
Hey Steve. Thanks for getting back to me.
Since my application will be distributed on optical media, it's impossible for me to adapt it to Mailman 3 later should the server ever be upgraded. I'd like to have it work with both interfaces, but it's impossible for me to do that right now because Mailman 3 is still experimental and I won't know how to communicate with it yet, let alone the static URL and API the server would expose whenever its is upgraded later.
I think what I'll do is contact Mark, as you suggested. Thanks a lot for your help.
-- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com

Kip Warner writes:
Does anyone have any suggestions or other feedback they'd like to share or propose a better solution?
The better solution is Mailman 3, which provides a REST API for programmatic administration, but it not going to be considered ready for production use (at least, not unless the admin is a Mailman 3 developer) for several months.
The only developer currently working on Mailman 2 at all is Mark Sapiro, who handles maintenance (ie, bug fixes and integration of "uncontroversial" minor feature patches). I think any change here is likely to be controversial, so won't make it to Mailman 2 in the near future.

On Mon, 2013-05-27 at 12:44 +0900, Stephen J. Turnbull wrote:
Hey Steve. Thanks for getting back to me.
Since my application will be distributed on optical media, it's impossible for me to adapt it to Mailman 3 later should the server ever be upgraded. I'd like to have it work with both interfaces, but it's impossible for me to do that right now because Mailman 3 is still experimental and I won't know how to communicate with it yet, let alone the static URL and API the server would expose whenever its is upgraded later.
I think what I'll do is contact Mark, as you suggested. Thanks a lot for your help.
-- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
participants (2)
-
Kip Warner
-
Stephen J. Turnbull