diff options
| author | bwarsaw | 1999-03-29 23:11:46 +0000 |
|---|---|---|
| committer | bwarsaw | 1999-03-29 23:11:46 +0000 |
| commit | ea42af85c8ba1b8dceb02ae9189b3fd474f4989f (patch) | |
| tree | 2a7a98a234d428fd3fa03985c7979ad3d67bbcb4 /Mailman/Digester.py | |
| parent | 2294974e88331fdbb2754a1fe77f9fa2929e0c0d (diff) | |
| download | mailman-ea42af85c8ba1b8dceb02ae9189b3fd474f4989f.tar.gz mailman-ea42af85c8ba1b8dceb02ae9189b3fd474f4989f.tar.zst mailman-ea42af85c8ba1b8dceb02ae9189b3fd474f4989f.zip | |
Sweeping changes to hopefully and finally (for 1.0 at least) make sane
address case matching. These changes require the DATA_FILE_VERSION to
be bumped, which should auto-update your config.db files. I sure hope
this works correctly! Details of changes:
MailList.GetUserSubscribedAddress(): New method. If the address is a
member, this returns the case-preserved address the user is subscribed
with. If not a member, None is returned.
MailList.GetUserCanonicalAddress(): New method. If the address is a
member, this returns the lowercased address the user is subscribed
with. If not a member, None is returned.
MailList.FindUser(): Wrote down, in a big comment, the constraints for
the dictionaries self.members, self.digest_members, self.passwords.
This wasn't always followed, but now it should be. FindUser() is now
also guaranteed to return the lowercased version of the subscribed
email address. This wasn't always the case. FindUser() also provides
a shortcut for the common case.
ApprovedAddMember(): Guarantee that passwords stored in self.passwords
are keyed off the lowercased address.
Deliverer.MailUserPassword(): Find the user's password using the
lowercased version of their address. However, be sure to use their
case-preserved address for the recipient of the password email.
Digester.SetUserDigest(): Fixed a fairly old bug where a user
switching from regular to digest membership (or vice versa) would get
their case-preserved address blown away. I don't think there's any
way to recover this information, but at least now we properly save it.
SecurityManager.ConfirmUserPassword(): Simplified address matching
stuff, since we now guarantee that FindUser() will return a lowercased
address, and that the passwords dictionary has lowercased keys.
FindUser() will return None if the address isn't found, and it also
has a built-in shortcut so that the more expensive
FindMatchingAddresses() isn't called in the common case. I eliminated
the case-insensitive password comparision that Ken rightly questioned
in his comment.
admin.py: In the list of members, display a member's case-preserved
address instead of their lowercased address. Also, obscure the URL in
the hyperlink (probably not terribly necessary).
handle_opts.py: When the password can't be found (when emailing it),
put the address we tried to find in the result message. Makes for
better debugging.
options.py: Use a better mechanism for finding if the member has a
case-preserved address different from their lowercased address.
Diffstat (limited to 'Mailman/Digester.py')
| -rw-r--r-- | Mailman/Digester.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Mailman/Digester.py b/Mailman/Digester.py index 306f65150..17e57028f 100644 --- a/Mailman/Digester.py +++ b/Mailman/Digester.py @@ -104,6 +104,7 @@ class Digester: addr = self.FindUser(sender) if not addr: raise Errors.MMNotAMemberError + cpuser = self.GetUserSubscribedAddress(addr) if self.members.has_key(addr): if value == 0: raise Errors.MMAlreadyUndigested @@ -111,7 +112,7 @@ class Digester: if not self.digestable: raise Errors.MMCantDigestError del self.members[addr] - self.digest_members[addr] = 1 + self.digest_members[addr] = cpuser else: if value == 1: raise Errors.MMAlreadyDigested @@ -123,7 +124,7 @@ class Digester: except AttributeError: self.one_last_digest = {addr: self.digest_members[addr]} del self.digest_members[addr] - self.members[addr] = 1 + self.members[addr] = cpuser self.Save() # Internal function, don't call this. |
