#9148 closed enhancement (wontfix)
Add explicit always_notify and always_notify_bcc options to ticket system.
| Reported by: | Owned by: | ||
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | notification | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
Many Trac instances make use of the smtp_always_bcc option to send all ticket notifications to a mailing list.  This is problematic as many plugins (e.g. the AccountManager or TicketModerator) directly leverage the notification system to send non-public administrative email.  The current workaround is for each plugin to either completely reimplement the notify() method or to hack the site configuration:
old_smtp_always_bcc = self.config.get('notification', 'smtp_always_bcc') # override the smtp_always_bcc option so that no emails are sent out to that address self.config.set('notification', 'smtp_always_bcc', '') try: NotifyEmail.notify(self, None, subject) finally: self.config.set('notification', 'smtp_always_bcc', old_smtp_always_bcc)
A better solution would be to add always_notify and always_notify_bcc options to the ticket system.  These options would specify users/addresses to add to the CC / BCC recipient lists for all ticket emails.  The former would be trivial to add (it would just return additional cc: addresses as part of the get_recipients() method).  Adding bcc: addresses would probably require modifying the get_recipients() method to return a 3-element tuple (to, cc, bcc).
Attachments (0)
Change History (6)
comment:1 by , 15 years ago
| Milestone: | → unscheduled | 
|---|
comment:2 by , 9 years ago
This could now be implemented as a INotificationSubscriber plugin.
This part of comment:8:ticket:5670 seems relevant here:
[notification] smtp_enabledThis setting is still used as described in (deprecated)
NotifyEmail, and it's now also used in the newEmailDistributorto disable sending of all emails.The setting disables sending of all emails. Without plugins, Trac only sends ticket notification emails, so the setting has a second role to disable sending of ticket notification emails. But with plugins, the setting can not fulfill both of these roles.
The description (of #5670) proposes plugins opt-out of the setting. I think
[notification] smtp_enabledindicates if the other[notification] smtp_*settings have been configured or not. So if it isFalseno emails should be sent, and plugins should not opt-out of that.comment:1:ticket:5670 instead proposes a second setting (
[ticket] notification_enabled). I think this is not needed anymore, as it is now possible to disable ticket notifications (but allow plugins to send other emails) by disabling components (e.g. ticket subscribers).
smtp_always_bccandsmtp_always_ccSame problem as above. Does always mean all emails or all ticket notification emails?
With
NotifyEmailit meant all emails and plugins had no good way to opt-out.In the new system
AlwaysEmailSubscriber(since #11934) implements these and still forwards all emails. Plugins probably now have enough flexibility to deal with this. (e.g. higher priority subscriptions, disabled components, using distributors directly…)
comment:3 by , 9 years ago
| Milestone: | unscheduled | 
|---|---|
| Resolution: | → wontfix | 
| Status: | new → closed | 
follow-up: 6 comment:4 by , 9 years ago
I think it might be nice that AlwaysEmailSubscriber respects [notification] smtp_always_{cc|bcc}.<realm> option and falls back to smtp_always_{cc|bcc} option (e.g. smtp_always_cc.ticket, smtp_always_cc.wiki, …).



  
PatchWelcome.