#8356 closed defect (fixed)
[PATCH] Email address in user preferences is not honored when user name contains an "@"
Reported by: | Robert Widhopf-Fenk | Owned by: | Remy Blank |
---|---|---|---|
Priority: | normal | Milestone: | 1.0 |
Component: | notification | Version: | 0.11.1 |
Severity: | major | Keywords: | consider, patch |
Cc: | lists@… | Branch: | |
Release Notes: |
Email address in user preferences are now used even when user name contains an "@" |
||
API Changes: | |||
Internal Changes: |
Description (last modified by )
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.
old new 277 277 return False 278 278 return True 279 279 280 if not is_email(address): 281 if address == 'anonymous': 280 if address == 'anonymous': 281 return None 282 283 if self.email_map.has_key(address): 284 address = self.email_map[address] 285 elif not is_email(address) and NotifyEmail.nodomaddr_re.match(address): 286 if self.config.getbool('notification', 'use_short_addr'): 287 return address 288 domain = self.config.get('notification', 'smtp_default_domain') 289 if domain: 290 address = "%s@%s" % (address, domain) 291 else: 292 self.env.log.info("Email address w/o domain: %s" % address) 282 293 return None 283 if self.email_map.has_key(address):284 address = self.email_map[address]285 elif NotifyEmail.nodomaddr_re.match(address):286 if self.config.getbool('notification', 'use_short_addr'):287 return address288 domain = self.config.get('notification', 'smtp_default_domain')289 if domain:290 address = "%s@%s" % (address, domain)291 else:292 self.env.log.info("Email address w/o domain: %s" % address)293 return None294 294 295 295 mo = self.shortaddr_re.search(address) 296 296 if mo:
Attachments (1)
Change History (11)
comment:1 by , 15 years ago
Summary: | Email addressin user preferences are not honored when user name looks like an email addess → Email address in user preferences is not honored when user name contains an "@" |
---|
comment:2 by , 15 years ago
Description: | modified (diff) |
---|
comment:3 by , 15 years ago
Keywords: | consider added |
---|---|
Milestone: | → 0.13 |
comment:4 by , 14 years ago
Milestone: | next-major-0.1X → 0.13 |
---|---|
Owner: | changed from | to
follow-ups: 6 7 comment:5 by , 14 years ago
Cc: | added |
---|
comment:6 by , 14 years ago
Replying to Thijs Triemstra <lists@…>:
to send to my_email @ [smtp_default_domain].
I meant my_trac_username @ [smtp_default_domain].
by , 14 years ago
Attachment: | 8356-email-priority-r10321.patch added |
---|
Give the e-mail address priorty over guessing from the user name.
comment:7 by , 14 years ago
Replying to Thijs Triemstra <lists@…>:
I tested the patch but couldn't see any difference, it always tried to send to my_email @ [smtp_default_domain]. Here's the same patch against 0.12-stable.
I must have misunderstood your comment, because I thought your patch didn't fix the issue. I came up with exactly the same fix (in 8356-email-priority-r10321.patch), and it passes the modified test case that checks for this.
Could you please test again if this patch solves the issue for you? The symptoms you describe may be unrelated.
comment:8 by , 14 years ago
Keywords: | patch added |
---|---|
Summary: | Email address in user preferences is not honored when user name contains an "@" → [PATCH] Email address in user preferences is not honored when user name contains an "@" |
Like I wrote in comment 5, I wasn't able to see a difference with the patch but I didn't have modauthkerb installed either so I'll leave it up to you rblank.
comment:9 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Thanks for the feedback. Patch applied in [10347].
comment:10 by , 12 years ago
Release Notes: | modified (diff) |
---|
I tested the patch but couldn't see any difference, it always tried to send to my_email @ [smtp_default_domain]. Here's the same patch against 0.12-stable.
trac/notification.py
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 addressdomain = 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