I work with academics, who seem to find perverse joy in needing to reorganize everything at least once a year. I wanted to post this somewhere before I lose it. The script renames a list from the command line, without having to do anything from the web GUI. It has always worked for me.
Instructions:
Stop mail service. # add this to the script so you don't need to remember to do it ./rename_list.sh oldListName NewListName # the names are usually all lowercase, JIC you get file/list not found errors. Start mail service. # add this to the script so you don't need to remember to do it

rename_list.sh contents:
#!/bin/bash
OLD=$1
NEW=$2
#service zimbra stop # zimbra being our mail program
service mailman stop
test -a /var/lib/mailman/archives/private/${NEW} && echo "*** That mailing list name already exists. *** "
mv /var/lib/mailman/lists/${OLD} /var/lib/mailman/lists/${NEW}
mv /var/lib/mailman/archives/private/${OLD} /var/lib/mailman/archives/private/${NEW} mv /var/lib/mailman/archives/private/${OLD}.mbox /var/lib/mailman/archives/private/${NEW}.mbox mv /var/lib/mailman/archives/private/${NEW}.mbox/${OLD}.mbox /var/lib/mailman/archives/private/${NEW}.mbox/${NEW}.mbox
/usr/lib/mailman/bin/arch --wipe ${NEW}
echo "real_name = '$NEW'" > temp.txt
echo "subject_prefix = '[$NEW]'" >> temp.txt
/usr/lib/mailman/bin/config_list -i temp.txt $NEW
rm temp.txt -f
/usr/lib/mailman/bin/genaliases
service mailman start
#service zimbra start

--
Ron King
IT Manager
Magdalena Ridge Observatory - New Mexico Tech
101 East Rd - Socorro, NM 87501
575-835-5772 phone - 878-835-6807 fax
[email protected]

------------------------------------------------------
Mailman-Users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9

Reply via email to