[Mailman-Users] Deleting Address in accept_these_nonmembers(was Add to filter from commandline?)

Mark Sapiro mark at msapiro.net
Sat Dec 22 20:59:45 CET 2007


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 at example.com')

but it would probably be better to do

user = 'user at 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 at 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 at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



More information about the Mailman-Users mailing list