#2365 closed enhancement (fixed)
Add default e-mail domain mapping
Reported by: | Owned by: | Emmanuel Blot | |
---|---|---|---|
Priority: | normal | Milestone: | 0.10 |
Component: | general | Version: | 0.9 |
Severity: | normal | Keywords: | notification email patch |
Cc: | mrw7mrw@… hshin@… nielsen@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
I am using Trac for an internal project, so every user has the same e-mail domain. I am also using LDAP, so I prefer to have people login with a username and not an e-mail address. At the same time, I would like people to be able to receive e-mail notifications when tickets are updated.
To accomplish this, I put together a small patch that adds a new configuration variable:
[notification] smtp_defaultdomain=mydomain.com
The patch is small and simply adds another elif statement within Notify.py:
around line 98: self.replyto_email = self.config.get('notification', 'smtp_replyto') self.from_email = self.from_email or self.replyto_email self.default_domain = self.config.get('notification', 'smtp_defaultdomai n') around line 309: for recipient in recipients: if recipient.find('@') >= 0: emails.append(recipient) elif self.email_map.has_key(recipient): emails.append(self.email_map[recipient]) elif self.default_domain != '': emails.append(recipient+'@'+self.default_domain)
The idea is that if the system currently can't resolve a username to an e-mail address, it simply appends the default domain to create the e-mail address. Although this isn't suitable for projects with users from different internet domains, it is very useful for projects like mine where every user has the same e-mail domain (i.e. they are all my employees).
Attachments (3)
Change History (12)
by , 19 years ago
comment:1 by , 19 years ago
Keywords: | notification email added |
---|
I also use LDAP, but as I have access to the SMTP server, I've set up the SMTP server to resolve the username into the user e-mail address, using the LDAP directory.
However, I agree that a default domain may also be useful.
comment:2 by , 19 years ago
Cc: | added |
---|
comment:3 by , 19 years ago
Cc: | added; removed |
---|
This feature should definitely be in the next release. Very useful for small company.
comment:4 by , 19 years ago
Cc: | added; removed |
---|
by , 19 years ago
Attachment: | trac-default-domain-2365.patch added |
---|
The same functionality as a patch
comment:5 by , 19 years ago
Cc: | added; removed |
---|
comment:6 by , 19 years ago
This is a duplicate of #464. And decided that it wasnt a neccessary enhancement.
comment:7 by , 19 years ago
Keywords: | patch added |
---|
No this is not a duplicate of #464 which was about mapping usernames to user accounts on the host where trac is running. This is about adding an optional fallback to a default domain name that you can configure in trac.ini which is more generic.
IMHO one good argument for having this feature is in a company setting with several trac environments you would otherwise require all users to either use full email adresses in the tickets or that all users set their full email adresses under 'settings' for each separate trac environment.
See also #1286 which describes the need for adding a default domain for ticket notification mails. I think #1286 can be closed because it's essentially about the same requirement but this ticket (#2365) is better since it contains a simpler and newer patch that can be applied to trac 0.9.
by , 19 years ago
Attachment: | trac-default-domain-0.9stable-2851.patch added |
---|
improved the patch a bit - applies to the 0.9 stable branch
comment:8 by , 19 years ago
Milestone: | → 0.10 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:9 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Should be fixed in [2936].
[notification]
option to use in trac.ini
is smtp_default_domain
.
Modified Notify.py