summaryrefslogtreecommitdiff
path: root/Mailman/Deliverer.py
diff options
context:
space:
mode:
authorbwarsaw1999-03-29 23:11:46 +0000
committerbwarsaw1999-03-29 23:11:46 +0000
commitea42af85c8ba1b8dceb02ae9189b3fd474f4989f (patch)
tree2a7a98a234d428fd3fa03985c7979ad3d67bbcb4 /Mailman/Deliverer.py
parent2294974e88331fdbb2754a1fe77f9fa2929e0c0d (diff)
downloadmailman-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/Deliverer.py')
-rw-r--r--Mailman/Deliverer.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/Mailman/Deliverer.py b/Mailman/Deliverer.py
index 590806b3c..127b8e86a 100644
--- a/Mailman/Deliverer.py
+++ b/Mailman/Deliverer.py
@@ -247,17 +247,16 @@ class Deliverer:
def MailUserPassword(self, user):
listfullname = '%s@%s' % (self.real_name, self.host_name)
ok = 1
- # find the case-preserved version of the user's address
- cpuser = self.members.get(self.FindUser(user))
- if type(cpuser) == type(''):
- user = cpuser
+ # find the lowercased version of the user's address
+ user = self.FindUser(user)
if user and self.passwords.has_key(user):
- recipient = self.GetMemberAdminEmail(user)
+ cpuser = self.GetUserSubscribedAddress(user)
+ recipient = self.GetMemberAdminEmail(cpuser)
subj = '%s mailing list reminder\n' % listfullname
# get the text from the template
text = Utils.maketext(
'userpass.txt',
- {'user' : user,
+ {'user' : cpuser,
'listname' : self.real_name,
'password' : self.passwords[user],
'options_url': self.GetAbsoluteOptionsURL(user),