2

I have some internal mailman mailing lists on my intranet. The company domain name has changed.

Can I automate the process of resigning '[email protected]' and assigning '[email protected]' from/to the list?

I have 11 lists, the busiest one has 17 members. So, not huge, but a huge pain to deal with manually.

2 Answers 2

1

Mailman has many commands to dump information and manipulate the lists. These are the commands that should be relevant if you are asking how to change the subscribed addresses of users from one domain to another.

  • list_lists - display all the lists
  • list_members - display the members of a list, can be redirected to a text file.
  • add_members - add members to a list, can take a file as input
  • remove_members - remove members from a list

Given those commands you should probably be able run through a simple process described by this psuedo shell code. You'll obviously want to clean this up to actually work and test it first. I don't have a system available at the moment I can test on.

for each list in `list_lists`
  # add members with new addresses
  add_members --welcome-msg=n --admin-notify=n \
   --file <(list_members {listname} | grep '@old-domain.com' | sed -e 's/old-domain.com/new-domain.com/') {listname} 
  # remove old addresses
  remove_members --file=<(list_members {listname} | grep '@old-domain.com') {listname}
1
  • Thanks - I need to find some time to re-visit this which won't be for a day or 2 now. Hopefully I'll be able to accept your answer then :-)
    – dr-jan
    Aug 9, 2011 at 17:39
1

Using Zoredache's excellent suggestions, I ended up processing each list in 3 stages, one for regular members and one for digest members, then a final pass to remove the old addresses. So, for each list I did this:

PATH=$PATH:/usr/lib/mailman/bin; export PATH

list_members --regular list_name | grep '@old_domain.com' | sed -e 's/old_domain/new_domain/' | add_members --welcome-msg=n --admin-notify=n --regular-members-file=- list_name
list_members --digest  list_name | grep '@old_domain.com' | sed -e 's/old_domain/new_domain/' | add_members --welcome-msg=n --admin-notify=n --digest-members-file=- list_name
list_members list_name | grep '@old_domain.com' | remove_members --file=- --nouserack --noadminack list_name

The PATH statement is needed because the mailman binaries are in an uncommon directory (/usr/lib/mailman/bin on my Fedora system).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .