Add explicit always_notify and always_notify_bcc options to ticket system.
|Reported by:||Owned by:|
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_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).