=== modified file 'Mailman/MailList.py' --- Mailman/MailList.py 2007-11-26 01:32:26 +0000 +++ Mailman/MailList.py 2008-02-23 23:14:01 +0000 @@ -1062,9 +1062,10 @@ newaddr = Utils.LCDomain(newaddr) Utils.ValidateEmail(newaddr) # Raise an exception if this email address is already a member of the - # list, but only if the new address is the same case-wise as the old - # address and we're not doing a global change. - if not globally and newaddr == oldaddr and self.isMember(newaddr): + # list, but only if the new address is the same case-wise as the + # existing member address and we're not doing a global change. + if not globally and (self.isMember(newaddr) and + newaddr == self.getMemberCPAddress(newaddr)): raise Errors.MMAlreadyAMember if newaddr == self.GetListEmail().lower(): raise Errors.MMBadEmailError @@ -1120,9 +1121,16 @@ raise Errors.MembershipIsBanned, pattern # It's possible they were a member of this list, but choose to change # their membership globally. In that case, we simply remove the old - # address. - if self.getMemberCPAddress(oldaddr) == newaddr: - self.removeMember(oldaddr) + # address. This gets tricky with case changes. We can't just remove + # the old address if it differs from the new only by case, because + # that removes the new, so the condition is if the new address is the + # CP address of a member, then if the old address yields a different + # CP address, we can simply remove the old address, otherwise we can + # do nothing. + if self.isMember(newaddr) and (self.getMemberCPAddress(newaddr) == + newaddr): + if self.getMemberCPAddress(oldaddr) <> newaddr: + self.removeMember(oldaddr) else: self.changeMemberAddress(oldaddr, newaddr) # If globally is true, then we also include every list for which @@ -1144,8 +1152,10 @@ mlist.Lock() try: # Same logic as above, re newaddr is already a member - if mlist.getMemberCPAddress(oldaddr) == newaddr: - mlist.removeMember(oldaddr) + if mlist.isMember(newaddr) and ( + mlist.getMemberCPAddress(newaddr) == newaddr): + if mlist.getMemberCPAddress(oldaddr) <> newaddr: + mlist.removeMember(oldaddr) else: mlist.changeMemberAddress(oldaddr, newaddr) mlist.Save()