/[smecontribs]/rpms/mailman/contribs8/mailman-2.1.9-global-address-change.patch
ViewVC logotype

Contents of /rpms/mailman/contribs8/mailman-2.1.9-global-address-change.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Fri Jul 12 21:04:22 2013 UTC (10 years, 9 months ago) by unnilennium
Branch: MAIN
CVS Tags: mailman-2_1_9-6_el5_6_1, mailman-2_1_9-20_el5_sme, mailman-2_1_9-6_el5_sme_20, HEAD
import new srpm

1 === modified file 'Mailman/MailList.py'
2 --- Mailman/MailList.py 2007-11-26 01:32:26 +0000
3 +++ Mailman/MailList.py 2008-02-23 23:14:01 +0000
4 @@ -1062,9 +1062,10 @@
5 newaddr = Utils.LCDomain(newaddr)
6 Utils.ValidateEmail(newaddr)
7 # Raise an exception if this email address is already a member of the
8 - # list, but only if the new address is the same case-wise as the old
9 - # address and we're not doing a global change.
10 - if not globally and newaddr == oldaddr and self.isMember(newaddr):
11 + # list, but only if the new address is the same case-wise as the
12 + # existing member address and we're not doing a global change.
13 + if not globally and (self.isMember(newaddr) and
14 + newaddr == self.getMemberCPAddress(newaddr)):
15 raise Errors.MMAlreadyAMember
16 if newaddr == self.GetListEmail().lower():
17 raise Errors.MMBadEmailError
18 @@ -1120,9 +1121,16 @@
19 raise Errors.MembershipIsBanned, pattern
20 # It's possible they were a member of this list, but choose to change
21 # their membership globally. In that case, we simply remove the old
22 - # address.
23 - if self.getMemberCPAddress(oldaddr) == newaddr:
24 - self.removeMember(oldaddr)
25 + # address. This gets tricky with case changes. We can't just remove
26 + # the old address if it differs from the new only by case, because
27 + # that removes the new, so the condition is if the new address is the
28 + # CP address of a member, then if the old address yields a different
29 + # CP address, we can simply remove the old address, otherwise we can
30 + # do nothing.
31 + if self.isMember(newaddr) and (self.getMemberCPAddress(newaddr) ==
32 + newaddr):
33 + if self.getMemberCPAddress(oldaddr) <> newaddr:
34 + self.removeMember(oldaddr)
35 else:
36 self.changeMemberAddress(oldaddr, newaddr)
37 # If globally is true, then we also include every list for which
38 @@ -1144,8 +1152,10 @@
39 mlist.Lock()
40 try:
41 # Same logic as above, re newaddr is already a member
42 - if mlist.getMemberCPAddress(oldaddr) == newaddr:
43 - mlist.removeMember(oldaddr)
44 + if mlist.isMember(newaddr) and (
45 + mlist.getMemberCPAddress(newaddr) == newaddr):
46 + if mlist.getMemberCPAddress(oldaddr) <> newaddr:
47 + mlist.removeMember(oldaddr)
48 else:
49 mlist.changeMemberAddress(oldaddr, newaddr)
50 mlist.Save()
51
52
53

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed