Project

General

Profile

Actions

Feature #13359

closed

Add project identifier to List-Id header in notification emails for better Gmail filtering

Added by Jimmy Engelbrecht almost 12 years ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Email notifications
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

This gives the possibility to filer mail-updates from different project into different folders.

--- ./redmine-2.1.6/app/models/mailer.rb        2013-01-09 17:34:07.000000000 +0100
+++ /opt/redmine-2.1.6/app/models/mailer.rb     2013-03-05 15:33:38.438398984 +0100
@@ -386,7 +386,7 @@
             'X-Auto-Response-Suppress' => 'OOF',
             'Auto-Submitted' => 'auto-generated',
             'From' => Setting.mail_from,
-            'List-Id' => "<#{Setting.mail_from.to_s.gsub('@', '.')}>" 
+            'List-Id' => "<#{@issue.project.identifier}.#{Setting.host_name}>" 

     # Removes the author from the recipients and cc
     # if he doesn't want to receive notifications about what he does

The resulting List-Id could look like this:

List-Id: <cantemo-ab.vvv.cantemo.com>

Files

13359.patch (2.85 KB) 13359.patch Go MAEDA, 2024-07-20 05:41

Related issues

Related to Redmine - Feature #10888: Bring back List-Id to help aid Gmail filteringClosedJean-Philippe Lang

Actions
Related to Redmine - Defect #14792: Don't add a display name and extra angle brackets in List-Id header fieldClosedGo MAEDA

Actions
Has duplicate Redmine - Feature #41031: Include project identifier in List-Id header field of notification emailsClosed

Actions
Actions #1

Updated by Jimmy Engelbrecht almost 12 years ago

Improvement to #10888

Actions #2

Updated by Mattias Amnefelt over 11 years ago

Here is an updated patch which doesn't croak on mails which are sent for non-issue updates (user info notifications for example)

--- redmine-2.1.6/app/models/mailer.rb.orig    2013-01-09 17:34:07.000000000 +0100
+++ redmine-2.1.6/app/models/mailer.rb    2013-04-16 11:33:00.057745141 +0200
@@ -380,13 +380,19 @@
   end

   def mail(headers={})
+    if @issue
+      listid = "<#{@issue.project.identifier}.#{Setting.host_name}>" 
+    else
+      listid = "#{Setting.host_name}>" 
+    end
+
     headers.merge! 'X-Mailer' => 'Redmine',
             'X-Redmine-Host' => Setting.host_name,
             'X-Redmine-Site' => Setting.app_title,
             'X-Auto-Response-Suppress' => 'OOF',
             'Auto-Submitted' => 'auto-generated',
             'From' => Setting.mail_from,
-            'List-Id' => "<#{Setting.mail_from.to_s.gsub('@', '.')}>" 
+            'List-Id' => listid

     # Removes the author from the recipients and cc
     # if he doesn't want to receive notifications about what he does
Actions #3

Updated by Etienne Massip over 11 years ago

  • Category set to Email notifications
Actions #4

Updated by Toshi MARUYAMA over 11 years ago

  • Related to Defect #14792: Don't add a display name and extra angle brackets in List-Id header field added
Actions #5

Updated by Go MAEDA 5 months ago

  • Has duplicate Feature #41031: Include project identifier in List-Id header field of notification emails added
Actions #6

Updated by Go MAEDA 5 months ago

I found this issue the day after I posted #41031. In #41031, I wrote as follows:

I propose adding the project identifier to the List-Id header field of notification emails. Currently, the List-Id is based on the emission email address (Setting.mail_from). I want to change the List-Id to include both the project identifier and the emission email address.

The current notification email headers include the X-Redmine-Project field, which contains the project identifier. However, widely used email services Gmail do not support filtering based on custom headers starting with X-. This makes it difficult to create filters based on the project.

By including the project identifier in the List-Id, users can utilize Gmail’s list operator to create filters based on the project. This enhancement would improve the ability to organize and manage project-related emails in Gmail.

I also posted an experimental implementation in #41031#note-1.

Actions #7

Updated by Go MAEDA 5 months ago

Regarding my patch in #41031#note-1 that introduces the new setting Setting.include_project_in_list_id to optionally exclude the project identifier from the List-Id field, now I believe this setting is unnecessary.

Users who filter all emails from a specific Redmine instance using the List-Id can achieve the same result by using the From field in their filters even if the List-Id value changes. Since there is an alternative method available, adding a new setting to keep the List-Id the same as the current value is redundant.

Actions #8

Updated by Go MAEDA 5 months ago

I have wrote a new patch.

The previously proposed patches include the project identifier in the List-Id only when an issue is created or updated. However, this new patch includes the project identifier in the List-Id for all notifications within the project, such as the creation and updating of wiki pages and posting messages to forums.

Actions #9

Updated by Go MAEDA 5 months ago

  • Target version changed from Candidate for next major release to 6.0.0

Setting the target to 6.0.0.

Actions #10

Updated by Go MAEDA 5 months ago

  • Subject changed from Better List-Id to help aid Gmail filtering to Add project identifier to List-Id header in notification emails for better Gmail filtering
  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the patch r22944.

The List-Id header field now includes a project identifier like:

List-Id: <ecookbook.redmine.example.net>

In this case, "ecookbook" is the project identifier.

Actions #11

Updated by Go MAEDA about 2 months ago

  • Tracker changed from Patch to Feature
Actions

Also available in: Atom PDF