Mailman fix_url.py

Reading Why aren’t my mm_cfg.py settings for DEFAULT_URL_PATTERN, DEFAULT_URL_HOST and DEFAULT_EMAIL_HOST effective? tells of /usr/lib/mailman/bin/fix_url.py which can be run on a single list like this:

 bin/withlist -l -r fix_url  [fix_url options]

Or run on all lists like this:

 bin/withlist -l -a -r fix_url -- [fix_url options]

Invoke fix_url.py by itself to get its help text:

jj5@sixsigma:/$ /usr/lib/mailman/bin/fix_url.py
Reset a list's web_page_url attribute to the default setting.

This script is intended to be run as a bin/withlist script, i.e.

% bin/withlist -l -r fix_url listname [options]

Options:
    -u urlhost
    --urlhost=urlhost
        Look up urlhost in the virtual host table and set the web_page_url and
        host_name attributes of the list to the values found.  This
        essentially moves the list from one virtual domain to another.

        Without this option, the default web_page_url and host_name values are
        used.

    -v / --verbose
        Print what the script is doing.

If run standalone, it prints this help text and exits.

So, for example:

root@sixsigma:/var/lib/mailman# vim /etc/mailman/mm_cfg.py
root@sixsigma:/var/lib/mailman# bin/withlist -l -a -r fix_url -- -v
Importing fix_url...
Running fix_url.fix_url()...
Loading list bizdev (locked)
Setting web_page_url to: https://intranet.blackbrick.com/cgi-bin/mailman/
Setting host_name to: blackbrick.com
Saving list
Loading list mailman (locked)
Setting web_page_url to: https://intranet.blackbrick.com/cgi-bin/mailman/
Setting host_name to: blackbrick.com
Saving list
Finalizing