[Mailman-Users] Unable to remove email with control chars from alist

Mark Sapiro msapiro at value.net
Fri Oct 22 21:19:40 CEST 2004


Hugo Kobayashi wrote:
>
>While investigating the problem, I discovered that his subscription
>has some control chars in the end of his email address. In the
>"Membership List" option of the admin web interface, the link to his
>subscription settings points to sth like this:
>
>https://host.tld/mailman/options/mylist/user--at--host.tld%0D%0A
>(note the 0x0d0a)
>
>If I try to unsubscribe him, I get an error page:
>
>Traceback (most recent call last):
>  File "/usr/local/mailman/scripts/driver", line 87, in run_main
>    main()
>  File "/usr/local/mailman/Mailman/Cgi/options.py", line 442, in main
>    mlist.DeleteMember(
>  File "/usr/local/mailman/Mailman/MailList.py", line 974, in DeleteMember
>    self.ApprovedDeleteMember(name, whence, admin_notif, userack)
>  File "/usr/local/mailman/Mailman/MailList.py", line 990, in
>ApprovedDeleteMember
>    self.removeMember(emailaddr)
>  File "/usr/local/mailman/Mailman/OldStyleMemberships.py", line 220,
>in removeMember
>    self.__assertIsMember(member)
>  File "/usr/local/mailman/Mailman/OldStyleMemberships.py", line 113,
>in __assertIsMember
>    raise Errors.NotAMemberError, member
>NotAMemberError: user at host.tld
>
>The command line interface doesn't work either:
>
>> bin/remove_members mylist user at host.tld
>No such member: user at host.tld
>
>I've also followed the instructions at:
>
>http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq03.013.htp
>(How do I remove a user name or email address with an illegal character in it?)
>
>with no success:
>
>% python -i bin/withlist -l mylist
>Loading list mylist (locked)
>The variable `m' is the mylist MailList instance
>>>> m.removeMember('na,user at host.tld') 
>Traceback (most recent call last):
>  File "<console>", line 1, in ?
>  File "/usr/local/mailman/Mailman/OldStyleMemberships.py", line 220,
>in removeMember
>    self.__assertIsMember(member)
>  File "/usr/local/mailman/Mailman/OldStyleMemberships.py", line 113,
>in __assertIsMember
>    raise Errors.NotAMemberError, member
>NotAMemberError: na,user at host.tld
>
>% python -i bin/withlist -l mylist
>Loading list mylist (locked)
>The variable `m' is the mylist MailList instance
>>>> del m.members['na,user at host.tld']
>Traceback (most recent call last):
>  File "<console>", line 1, in ?
>KeyError: na,user at host.tld

It looks like you aren't following the instructions correctly.

First of all, the "na," is part of the example bad address. I.e. in the
example the bad address is "name at example.com" with a comma in the
middle of "name" making it "na,me at example.com"

What you need is

  m.removeMember('user at host.tld\r\n')
or
  m.removeMember('user at host.tld\x0d\x0a')

or if that doesn't work

  del m.members['user at host.tld\r\n']
or
  del m.members['user at host.tld\x0d\x0a']

>
>I've also applied the badchar.patch from
>https://sourceforge.net/tracker/?func=detail&atid=100103&aid=1030228&group_id=103,
>but as I expected it doesn't solve the problem of removing a malformed
>email address.

Right, it only helps prevent adding one.

--
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