{"id":162,"date":"2006-12-14T21:47:21","date_gmt":"2006-12-14T20:47:21","guid":{"rendered":"http:\/\/mattiesworld.gotdns.org\/weblog\/2006\/12\/14\/mailman-chronicles\/"},"modified":"2006-12-14T21:47:21","modified_gmt":"2006-12-14T20:47:21","slug":"mailman-chronicles","status":"publish","type":"post","link":"https:\/\/mattiesworld.gotdns.org\/weblog\/2006\/12\/14\/mailman-chronicles\/","title":{"rendered":"Mailman chronicles"},"content":{"rendered":"<p>ok, so you know <a target=\"_blank\" title=\"Mailman mailing list manager\" href=\"http:\/\/www.gnu.org\/software\/mailman\/\">mailman<\/a>? But how to fetch a subscribers list without using the admin interface?<\/p>\n<p>Mailman does not use a database nor does it store a list&#8217;s subscribers in some plain text format. So how to start? I searched the mailman mailinglist archive and didn&#8217;t find a clue. I looked a bit at the code, but it&#8217;s hard to get started if you&#8217;re not into python. \ud83d\ude09<br \/>\nBy searching the mailman dir I found a .pck file.. It&#8217;s a pickled file. \ud83d\ude42 This seems to be the <a target=\"_blank\" href=\"http:\/\/docs.python.org\/lib\/module-pickle.html\">Python term for serialization<\/a>. So I found a mailinglist in its pickled state which seemed to contain the subscribers. Mmm, okay, let&#8217;s download the mailman source and find the usages of the pickle library.. Got it! \ud83d\ude42 So hooray, fire up that <a target=\"_blank\" title=\"Python eclipse plugin\" href=\"http:\/\/pydev.sourceforge.net\/\">python eclipse plugin<\/a> that I&#8217;ve been eager to try out on a real piece of code, open up those nice <a title=\"python ref 1\" target=\"_blank\" href=\"http:\/\/www.diveintopython.org\/\">python<\/a> <a title=\"python ref 2\" target=\"_blank\" href=\"http:\/\/www.mindview.net\/Books\/TIPython\">references<\/a> and let&#8217;s unpickle!<\/p>\n<p>Ehrm.. wait a second.. Apparently, downloading the source code can reveal other interesting parts of mailman. Like, for example, a script that lists all subscribers? =)<\/p>\n<p>Another lesson learned with open source projects: FIRST download the source, before you try to hack it in yourself \ud83d\ude09 Okay, looking at the mailman installation dir would have been sufficient too, but who likes to search some custom installed linux distro over some <a title=\"crappy provider\" target=\"_blank\" href=\"http:\/\/www.hostforweb.com\/\">crappy remote connection<\/a>? \ud83d\ude09<\/p>\n<p>There is still one step to do: how to get that script&#8217;s output on a webpage? One could try cgi or php for example. I looked at how mailman does it, but I guess it uses some precompiled &#8216;trusted&#8217; executables for that hooked up to apache. After writing a php script, I realised it wouldn&#8217;t run on a normal user account, d&#8217;oh \ud83d\ude42<br \/>\nThe problem is not the mailman script itself, but the mailman databases it tries to open. The pickled mailing lists are only readable for users in the mailman group. I didn&#8217;t want to open a security hole (everyone has already enough spam), so I set up a <a title=\"cron tab file format\" target=\"_blank\" href=\"http:\/\/www.adminschoice.com\/docs\/crontab.htm\">cron<\/a> job which executes the mailman script and puts the output readable to the normal user. It is not as cool as having the actual data, but having it on a daily basis is sufficient.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ok, so you know mailman? But how to fetch a subscribers list without using the admin interface? Mailman does not use a database nor does it store a list&#8217;s subscribers in some plain text format. So how to start? I searched the mailman mailinglist archive and didn&#8217;t find a clue. I looked a bit at &hellip; <a href=\"https:\/\/mattiesworld.gotdns.org\/weblog\/2006\/12\/14\/mailman-chronicles\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Mailman chronicles<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,2],"tags":[],"class_list":["post-162","post","type-post","status-publish","format-standard","hentry","category-linux","category-web"],"_links":{"self":[{"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/posts\/162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/comments?post=162"}],"version-history":[{"count":0,"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/posts\/162\/revisions"}],"wp:attachment":[{"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/media?parent=162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/categories?post=162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/tags?post=162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}