Upon their initial registration, many users entered their email address
in upper or mixed case. The email > username(s) lookup is meant to
alleviate the number of support requests, allowing members to receive
password reminders even if they forget their registration handles.

Advertising

This means they have not only forgotten their password but also their
userid?
If they still know the userid, you can directly access the corresponding
user record.
If you did not store the userid normalized, then the best way
would be to do normalization of the userid.

Yes, that's correct: they forget their userids on a regular basis. And
yes, userids are already stored normalized. *Forgotten* userids is why I
implemented the hack in mail_password (see below).

Which brings me to my original Q...
Is there a better way than the two-step approach I'm following:
emails = context.portal_membership.searchMembers('email','')
and then iterate over emails to find the matches
if (member==string.lower(emails[n].values()[1])):

Or if this can't be done in a less costly way, where would I start with
normalizing the email address records that are already stored?