[Mailman-Users] Munged addresses

Mark Sapiro msapiro at value.net
Tue Oct 18 23:33:57 CEST 2005


Bob Morse wrote:

>Thanks. I'm not sure I feel comfortable dinking around in those files. I
>guess the user will have to live with those addresses for now.

OK. Here are some other things you might feel comfortable with. I
suspect the first two won't work, but they are worth a try.

1) click on the bad address link on the member list. if this gets you
to an options page for the bad address, check the 'Yes, I really want
to unsubscribe' box and click 'Unsubscribe'.

2a) if 1) doesn't work, try

bin/list_members --output bad_member_file --invalid list_name

Check the contents of bad_member_file to make sure it doesn't contain
any good entries. It may not contain all the bad ones either. If it
doesn't, you could do

bin/list_members --output member_file list_name

and edit that to remove the good ones or copy/paste the missing bad
ones.

2b) Then try

bin/remove_members --file=bad_member_file list_name

3) You may not be comfortable with this one, but if 2b) doesn't work,
try this:

$ bin/withlist -l listname
Loading list listname (locked)
The variable `m' is the listname MailList instance
>>> fp = open('bad_address_file', 'r')
>>> for address in fp.readlines():
...     addr = address.strip()
...     try:
...         m.removeMember(addr)
...         print 'Removed', addr
...     except Errors.NotAMemberError:
...         print 'Not a member', addr
...
Not a member a at b.c
Not a member d at e.f
Not a member g at h.i
>>> m.Save()
>>>
Unlocking (but not saving) list: listname
Finalizing
$

In the above, '$' is a shell prompt; '>>>' and '...' are Python
prompts; other lines are responses from Python. The input to the final
... prompt is a new-line (CR or Enter) and the input to the final >>>
prompt is control-D (Unix end of file). The indentation on the ...
prompted lines is important.

In my case, bad_address_file contained the 3 addresses a at b.c, d at e.f and
g at h.i, none of which were list members.

If you are not happy with what you see at any point, you can just type
the control-D without first entering m.Save() and the list will not be
changed.

-- 
Mark Sapiro <msapiro at value.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