[Mailman-Users] Default conceal from subscriber list setting

Todd Freedom_Lover at pobox.com
Sun Oct 5 09:53:28 CEST 2003

Paul H Byerly wrote:
> I'd like to be able to set a list so the default setting for
> "Conceal yourself from subscriber list?" is "Yes" rather than no.
> Don't see an option for this in Defaults.py.

AFAIK, you need to set DEFAULT_NEW_MEMBER_OPTIONS.  To change the
default for concealing new members, you would subtract 16 from the
current setting (256 by default).  So, set


in mm_cfg.py and then all new lists will inherit this setting.  To
apply this to an existing list, I think you need a withlist script,
but I could be wrong (I don't know mailman that well and I've had more
than a few choice beverages so far tonight).

If you do find that a withlist script is required, as I did when
testing this, you might find the quickie I whipped up to be useful
(which I ripped off completely from fix_url.py).  I'll attach it, just
in case you want it.  The path to python might need adjusted, my local
mailman install is on a Red Hat 7.3 box, where python 2 is installed
as /usr/bin/python2.

This will change the setting to DEFAULT_NEW_MEMBER_OPTIONS.  If you
want to change a list to something else, pass the --options argument
to the script.  Note that there's absolutely no checking done on the
value you pass to this argument.

HTH (and more importantly, I hope it works),

Todd        OpenPGP -> KeyID: 0xD654075A | URL: www.pobox.com/~tmz/pgp
Cogito cogito ergo cogito sum --
I think that I think, therefore I think that I am.
        -- Ambrose Bierce, "The Devil's Dictionary"

-------------- next part --------------
#! /usr/bin/python2
# Copyright (C) 2001,2002 by the Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

"""Reset a list's new_member_options attribute to the default setting.

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

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

    -o / --options
        Set new_member_options to the value given.  See the section on
	"Bitfield for user options" in Defaults.py for details.

        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.

import sys
import getopt

import paths
from Mailman import mm_cfg
from Mailman.i18n import _

def usage(code, msg=''):
    print _(__doc__.replace('%', '%%'))
    if msg:
        print msg

def update_mem_opts(mlist, *args):
        opts, args = getopt.getopt(args, 'o:v', ['options', 'verbose'])
    except getopt.error, msg:
        usage(1, msg)

    options = None
    verbose = 0
    for opt, arg in opts:
        if opt in ('-o', '--options'):
            options = arg
        elif opt in ('-v', '--verbose'):
            verbose = 1

    if options:
	new_member_options = options
	new_member_options = mm_cfg.DEFAULT_NEW_MEMBER_OPTIONS

    if verbose:
	print 'Setting new_member_options to %s' % new_member_options
    mlist.new_member_options = new_member_options

    if verbose:
	print _('Saving list')


if __name__ == '__main__':
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 254 bytes
Desc: not available
Url : http://mail.python.org/pipermail/mailman-users/attachments/20031005/cdfbe3db/attachment.pgp 

More information about the Mailman-Users mailing list