Opened 12 years ago
Closed 11 years ago
#10846 closed defect (worksforme)
admit_domains value not effect to mail notification.
Reported by: | masato-ka | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | notification | Version: | 0.12.2 |
Severity: | normal | Keywords: | admit_domains |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
We found a bug on admit_domains options. Intrinsically, admit_domains can do designation email address using domain. because, Trac admin screen describe to admit_domains below to "Comma-separated list of domains that should be considered as valid for email addresses (such as localdomain)." But, not behave it.
I read souce code "trac/notification.py". and I fixed this bug.
-
trac/trac/notification.py
267 267 admit_domains = self.env.config.get('notification', 'admit_domains') 268 268 if admit_domains: 269 269 pos = addrfmt.find('@') 270 row_domains = [x.strip() for x in admit_domains.split(',')] 271 admit_re = re.compile(r'[\w\d_\.\-\*]+') 272 for row_domain in row_domains: 273 if not admit_re.match(row_domain): 274 raise TracError("Invalid format admit_domains. %s" % admit_domains) 270 275 domains = '|'.join([x.strip() for x in \ 271 admit_domains.replace('.','\.').split(',')]) 272 addrfmt = r'%s@(?:(?:%s)|%s)' % (addrfmt[:pos], addrfmt[pos+1:], 273 domains) 276 admit_domains.replace('.','\.').split(',')]) 277 if domains: 278 addrfmt = r'%s@(?:%s)' %(addrfmt[:pos],domains) 279 else: 280 addrfmt = r'%s@(?:(?:%s)|%s)' % (addrfmt[:pos], addrfmt[pos+1:], 281 domains) 274 282 self.shortaddr_re = re.compile(r'\s*(%s)\s*$' % addrfmt) 275 283 self.longaddr_re = re.compile(r'^\s*(.*)\s+<\s*(%s)\s*>\s*$' % addrfmt) 276 284 self._init_pref_encoding()
Perhaps, Other version trac(1.0) have same bug.
Please fixed to your trunk.
Regards masato-ka.
Attachments (0)
Change History (3)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Milestone: | → undecided |
---|
All the tickets for {20} from last year have probably been seen multiple times by now, yet are still to be triaged…
comment:3 by , 11 years ago
Milestone: | undecided |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
This is not a bug.
admit_domains
option provides a way to add valid domains for users if the domain is a local domain name (e.g.root@localhost
,root@localdomain
, etc…). The option doesn't provide a way to restrict the email domains.