[Mailman-Users] Python remote urllib.request -> mailman subscription

Kip Warner kip at thevertigo.com
Fri May 17 10:50:49 CEST 2013

Hey list,

I'm not sure if anyone has done this before (probably), but I figured
I'd run my solution by those more knowledgeable of the inner workings of
GNU Mailman. 

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/mailman-users/attachments/20130517/47487519/attachment.pgp>

More information about the Mailman-Users mailing list