[Mailman-Users] config_list and stdin (was: Quick & easy host/domainname change?)

Dave Sherohman esper at sherohman.org
Thu Sep 14 07:54:05 CEST 2000


Gregory Leblanc said:
> Know python?  Nah, me either, but it should be fairly easy to program
> something to do that.  The 'withlist' command loads the list into the object
> m, it should be possible to do something very similar, just giving it a list
> of lists to open, and the sub-object (sorry, I don't do OOP) to open and
> change.  Clear as mud?  

My installation of mailman (2.0beta5-1, Debian flavor) doesn't have withlist
(I presume that's 1.1-specific), but it does have config_list, which seems
like it should be usable for the sort of thing being discussed here.

There's one thing, though, which would make it much more useful:  The ability
to read from stdin.  It can currently write to stdout (with -o -), but trying
to tell it to use stdin (with -i -) results in an "IOError: [Errno 2] No such
file or directory".

If reading from stdin were available, changing domain names would be a
breeze:

config_list -o - my-list | sed -e s/old.domain.org/new.domain.com/g |
config_list -i - my-list

As it stands now, it appears that you have to create a temporary file for
each list, i.e.:

config_list -o - my-list | sed -e s/old.domain.org/new.domain.com/g >
/tmp/my-list && config_list -i /tmp/my-list my-list ; rm /tmp/my-list

(Note:  I would expect this to be a fairly easy thing to fix, but I don't
speak Python, so I could be wrong.  Since I'm spouting off about it in
public, I will take the time to look at it and see if I can make the fix
myself, but, again, I don't speak Python.  If someone who knows the code
could address this, that would be greatly appreciated.)

(Note 2:  Command lines above are off the top of my head and have not been
tested.  If you use them, back up your list configs first, just in case they
don't perform as I intended.)

-- 
"Two words: Windows survives." - Craig Mundie, Microsoft senior strategist
"So does syphillis. Good thing we have penicillin." - Matthew Alton
Geek Code 3.1:  GCS d- s+: a- C++ UL++$ P+>+++ L+++>++++ E- W--(++) N+ o+
!K w---$ O M- V? PS+ PE Y+ PGP t 5++ X+ R++ tv b+ DI++++ D G e* h+ r++ y+




More information about the Mailman-Users mailing list