Project

General

Profile

Actions

Feature #7017

closed

Add watchers from To and Cc fields in issue replies

Added by Lucas Panjer almost 14 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Email receiving
Target version:
Start date:
2010-12-02
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Description

If this preference is true watchers are added to an issue from the to: and cc: fields of an issue email reply.


Files

email_setting.patch (1.89 KB) email_setting.patch Lucas Panjer, 2010-12-02 08:19
non-member-issue-view.png (25.2 KB) non-member-issue-view.png Toshi MARUYAMA, 2016-03-16 07:07
terminal.png (55.7 KB) terminal.png Toshi MARUYAMA, 2016-03-16 07:07
admin-issue-view.png (28.9 KB) admin-issue-view.png Toshi MARUYAMA, 2016-03-16 07:07
non-member-role.png (15.5 KB) non-member-role.png Toshi MARUYAMA, 2016-03-16 07:07

Related issues

Related to Redmine - Patch #8009: Allow to specify watches for issues created by e-mailClosed2011-03-29

Actions
Actions #1

Updated by Stanislav German-Evtushenko almost 14 years ago

Patches usually aren't accepted without tests.

Actions #2

Updated by Deoren Moor almost 11 years ago

+1

This behavior would be very beneficial to our group.

Actions #3

Updated by Deoren Moor about 10 years ago

+1

This would be very helpful.

Actions #4

Updated by Josef Reichardt about 10 years ago

+1

Actions #5

Updated by Jean-Baptiste Barth about 10 years ago

Can anybody explain me this patch like I'm 5 ? What's the current behaviour, and what's the new proposed one ?

It would add "to/cc" persons in an incoming email as watchers of the issue automatically ??

Actions #6

Updated by Josef Reichardt about 10 years ago

I haven't tested the patch (because I hope it will be merged into redmine core), but the current behaviour is: Users are added as watcher from to/cc if you create an issue by email. But if you reply to an email from redmine (to add a comment to the issue) the additional to/cc users from this second email aren't added as watcher.

Actions #7

Updated by Michael Esemplare about 10 years ago

Looking at the mail_handler today, MailHandler.receive_issue calls add_watchers(issue) before saving the issue off so email's entered in the To: and CC: fields will be added as watchers and can reply to the email.

This patch puts add_watchers(issue) in MailHandler.receive_issue_reply (I think) after the issue was saved. Therefore the watchers will be added, but not notified of the issue update. I am skeptical that behavior was intended by the patch. I would call add_watchers before saving the issue.

Would there be any repercussions to:

--- app/models/mail_handler.rb     2014-07-14 21:54:18.578473500 -0700
+++ app/models/mail_handler.rb    2014-09-11 22:44:16.975595000 -0700
@@ -231,6 +231,9 @@
     issue.safe_attributes = issue_attributes_from_keywords(issue)
     issue.safe_attributes = {'custom_field_values' => custom_field_values_from_keywords(issue)}
     journal.notes = cleaned_up_text_body
+
+    # add To and Cc as watchers before saving so the watchers can reply to Redmine
+    add_watchers(issue)
     add_attachments(issue)
     issue.save!
     if logger

Does the add_watcher method in acts_as_watchable automatically handle duplicates?

Actions #8

Updated by Sebastian Paluch almost 9 years ago

+100

Please include this tiny patch into official release, it is annoying when people are adding others in CC, email traffic grows but when update is done in Redmine some users are not informed.

Actions #9

Updated by Toshi MARUYAMA almost 9 years ago

  • Target version set to 3.3.0
Actions #10

Updated by Go MAEDA almost 9 years ago

I don't think we have to add a new setting to enable / disable the feature.

When you create an issue via email, there is no setting to determine if users included in CC are added as watchers. They are always added as watchers in this case. To maintain consistency, when updating an issue the same behavior should apply. The more settings we have the more complex things become.

Actions #11

Updated by Sebastian Paluch almost 9 years ago

Go MAEDA wrote:

I don't think we have to add a new setting to enable / disable the feature.

When you create an issue via email, there is no setting to determine if users included in CC are added as watchers. They are always added as watchers in this case. To maintain consistency, when updating an issue the same behavior should apply. The more settings we have the more complex things become.

The thing is that users from CC are not always added as watchers. This works only for new issues but does not works for reply/updates. This patch fixes the issue by adding add_watchers(issue) in mail_handler.rb.

Actions #12

Updated by Deoren Moor almost 9 years ago

Go MAEDA wrote:

They are always added as watchers

Sorry if this is a tangent that deserves its own issue, but I thought it might be relevant to the discussion:

For emails that are scraped and placed into a specific project (that most users do not have access to) by the scraping script it appears that the CC field is ignored for new issues/tickets. I've not tested the functionality by temporarily allowing ALL users into the project, so this might be an edge case that most folks don't care about.

Example:

rake -f /opt/redmine/Rakefile redmine:email:receive_imap \
    RAILS_ENV="development" \
    port=993 \
    ssl=1 \
    host=imap.example.com \
    folder=Inbox \
    username=redmine@example.com \
    password=SomethingSecret \
    project=unassigned \
    category=unassigned \
    tracker=support \
    no_permission_check=1 \
    unknown_user=accept \
    move_on_success=processed_emails \
    move_on_failure=rejected_emails \
    allow_override=project,tracker,priority,category,status,resolution
Actions #13

Updated by Jean-Philippe Lang almost 9 years ago

  • Tracker changed from Patch to Feature
  • Subject changed from add watchers from to: and cc: fields in email replies to Add watchers from To and Cc fields in issue replies
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Go MAEDA wrote:

I don't think we have to add a new setting to enable / disable the feature.

Agreed, cange done in r15092 without adding a setting for this.

Actions #14

Updated by Jean-Philippe Lang almost 9 years ago

Deoren Moor wrote:

Sorry if this is a tangent that deserves its own issue, but I thought it might be relevant to the discussion:

For emails that are scraped and placed into a specific project by the scraping script (that most users do not have access to) it appears that the CC field is ignored for new issues/tickets. I've not tested the functionality by temporarily allowing ALL users into the project, so this might be an edge case that most folks don't care about.

Watchers were not added if the user is not allowed to add watchers in the target project. I guess this is why watchers are not added in your case. This should be fixed in r15093.

Actions #15

Updated by Toshi MARUYAMA almost 9 years ago

  • Status changed from Closed to Reopened

I think mail recipients who do not have "View watchers list" permission can see watches as CC.
For example, non members on redmine.org do not have "View watchers list" permission.

Actions #16

Updated by Jean-Philippe Lang over 8 years ago

  • Assignee changed from Jean-Philippe Lang to Toshi MARUYAMA

Toshi MARUYAMA wrote:

I think mail recipients who do not have "View watchers list" permission can see watches as CC.
For example, non members on redmine.org do not have "View watchers list" permission.

How is it related to this issue? The mail handler was already adding cc as watchers when creating an issue, now it behaves the same when replying to an issue. If I understand correctly, the problem you describe is about notifications, not the mail handler. Those who doesn't want to let users see watchers email addresses in notifications should use Bcc for recipients, which is the default.

Actions #17

Updated by Toshi MARUYAMA over 8 years ago

Non member role

Admin issue view

Non member issue view

Should not show CC to non member

Actions #18

Updated by Jean-Philippe Lang over 8 years ago

  • Status changed from Reopened to Closed

Thanks for your feedback. But this issue is not about notifications, it just adds cc of issue replies as watchers, just like when receiving a new issue.

Actions #19

Updated by Toshi MARUYAMA over 8 years ago

  • Assignee deleted (Toshi MARUYAMA)
Actions

Also available in: Atom PDF