Opened 15 years ago
Last modified 12 years ago
#8356 closed defect
Email addressin user preferences are not honored when user name looks like an email addess — at Initial Version
Reported by: | Robert Widhopf-Fenk | Owned by: | Emmanuel Blot |
---|---|---|---|
Priority: | normal | Milestone: | 1.0 |
Component: | notification | Version: | 0.11.1 |
Severity: | major | Keywords: | consider, patch |
Cc: | lists@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
We are using http://modauthkerb.sourceforge.net/ for single sign on and this generates user names of the form USER@REALM. Users have set their email addresses in the preferences, but they are not used as the user name already contains an "@" and is considered as an email address.
The following patch against 0.11.1 changes the code to honor the email address if one is given and to do the other guessing only if there is none.
—- notification.py-org 2009-06-05 13:56:08.000000000 +0200 +++ notification.py 2009-06-05 14:02:58.000000000 +0200 @@ -277,20 +277,20 @@
return False
return True
- if not is_email(address):
- if address == 'anonymous':
+ if address == 'anonymous': + return None + + if self.email_map.has_key(address): + address = self.email_map[address] + elif not is_email(address) and NotifyEmail.nodomaddr_re.match(address): + if self.config.getbool('notification', 'use_short_addr'): + return address + domain = self.config.get('notification', 'smtp_default_domain') + if domain: + address = "%s@%s" % (address, domain) + else: + self.env.log.info("Email address w/o domain: %s" % address)
return None
- if self.email_map.has_key(address):
- address = self.email_map[address]
- elif NotifyEmail.nodomaddr_re.match(address):
- if self.config.getbool('notification', 'use_short_addr'):
- return address
- domain = self.config.get('notification', 'smtp_default_domain')
- if domain:
- address = "%s@%s" % (address, domain)
- else:
- self.env.log.info("Email address w/o domain: %s" % address)
- return None
mo = self.shortaddr_re.search(address) if mo: