[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mailman-users
Subject:    Re: [Mailman-Users] Deleting Address in accept_these_nonmembers(was
From:       Mark Sapiro <mark () msapiro ! net>
Date:       2007-12-22 19:59:45
Message-ID: PC17602007122211594502031679bb78 () msapiro
[Download RAW message or body]

Barry Finkel wrote:
>
>>From a posting back in August:
>
>Willendrup, Peter Kjær wrote:
>>> 
>>> My real question is: Is it possible to add addresses to the 'accepts' filter
>>> of a mailinglist from the commandline?
>
>And Mark Sapiro replied:
>>Not directly, but in a shell script you could prepare a file that looks like
>>
>>mlist.accept_these_nonmembers.append('usera at example.com')
>>mlist.accept_these_nonmembers.append('userb at example.com')
>>
>>and so on for all the non-members you want to add and then run
>>
>>bin/config_list -i filename listname
>>
>>where filename is the name of the above file.
>
>I have implemented a script to add an address to
>
>     accept_these_nonmembers
>
>in a collection of Mailman lists, and I am wondering if there is a
>similar mechanism for deleting an address in
>
>     accept_these_nonmembers
>
>in a collection of Mailman lists.


mlist.accept_these_nonmembers.remove('user@example.com')

but it would probably be better to do

user = 'user@example.com'
try:
    mlist.accept_these_nonmembers.remove(user)
except ValueError:
    print 'User: %s not in accept_these_nonmembers' % user

or maybe just

try:
    mlist.accept_these_nonmembers.remove('user@example.com')
except ValueError:
    pass

but, now you're getting into the realm of Python coding and it would be
better still to write a complete Python script rather than using
config_list.

-- 
Mark Sapiro <mark@msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

------------------------------------------------------
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: http://mail.python.org/mailman/options/mailman-users/mailman-users%40progressive-comp.com

Security Policy: http://www.python.org/cgi-bin/faqw-mm.py?req=show&amp;file=faq01.027.htp

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic