Edgewall Software
Modify

Opened 10 years ago

Closed 3 years ago

Last modified 3 years ago

#9148 closed enhancement (wontfix)

Add explicit always_notify and always_notify_bcc options to ticket system.

Reported by: jsiirola@… Owned by:
Priority: normal Milestone:
Component: notification Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API 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 (5)

comment:1 by Christian Boos, 9 years ago

Milestone: unscheduled

comment:2 by Peter Suter, 3 years ago

This could now be implemented as a INotificationSubscriber plugin.

This part of comment:8:ticket:5670 seems relevant here:

  1. [notification] smtp_enabled

This setting is still used as described in (deprecated) NotifyEmail, and it's now also used in the new EmailDistributor to 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_enabled indicates if the other [notification] smtp_* settings have been configured or not. So if it is False no 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).

  1. smtp_always_bcc and smtp_always_cc

Same problem as above. Does always mean all emails or all ticket notification emails?

With NotifyEmail it 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 Peter Suter, 3 years ago

Milestone: unscheduled
Resolution: wontfix
Status: newclosed

comment:4 by Jun Omae, 3 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, …).

comment:5 by Peter Suter, 3 years ago

Sounds interesting.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to as closed The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.