changeset 5750:2c0f89edabe1

issue2551043: Add X-Roundup-issue-id email header. Add a new header to make it easier to filter notification emails without having to parse the subject line. Modified tests to account for new header.
author John Rouillard <rouilj@ieee.org>
date Sat, 01 Jun 2019 13:19:14 -0400
parents 943e61bc26d5
children 5cb6e6b594b0
files CHANGES.txt roundup/roundupdb.py test/test_mailgw.py
diffstat 3 files changed, 52 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES.txt	Sat Jun 01 09:05:23 2019 -0400
+++ b/CHANGES.txt	Sat Jun 01 13:19:14 2019 -0400
@@ -82,6 +82,9 @@
   limit mechanism added for web page logins. Default is 3 login
   attempts/minute for a user. After which one login attempt every 20
   seconds can be done. (John Rouillard)
+- issue2551043: Add X-Roundup-issue-id email header. Add a new header
+  to make it easier to filter notification emails without having to
+  parse the subject line. (John Rouillard)
 
 Fixed:
 
--- a/roundup/roundupdb.py	Sat Jun 01 09:05:23 2019 -0400
+++ b/roundup/roundupdb.py	Sat Jun 01 13:19:14 2019 -0400
@@ -595,6 +595,16 @@
                 except UnicodeError:
                     message[header] = Header(values, charset)
 
+            # Add header for main id number to make filtering
+            # email easier than extracting from subject line.
+            header = "X-Roundup-%s-Id"%(self.classname)
+            values = issueid
+            try:
+                values.encode('ascii')
+                message[header] = values
+            except UnicodeError:
+                message[header] = Header(values, charset)
+
             if not inreplyto:
                 # Default the reply to the first message
                 msgs = self.get(issueid, 'messages')
--- a/test/test_mailgw.py	Sat Jun 01 09:05:23 2019 -0400
+++ b/test/test_mailgw.py	Sat Jun 01 13:19:14 2019 -0400
@@ -559,6 +559,7 @@
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
 X-Roundup-Issue-Status: unread
+X-Roundup-Issue-Id: 1
 Content-Transfer-Encoding: quoted-printable
 
 
@@ -605,6 +606,7 @@
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
 X-Roundup-Issue-Status: unread
+X-Roundup-Issue-Id: 1
 Content-Transfer-Encoding: quoted-printable
 
 This is a test submission of a new issue.
@@ -648,6 +650,7 @@
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
 X-Roundup-Issue-Status: unread
+X-Roundup-Issue-Id: 1
 Content-Transfer-Encoding: quoted-printable
 
 New submission from Bork, Chef:
@@ -977,6 +980,7 @@
 X-Roundup-Loop: hello
 X-Roundup-Issue-Status: chatting
 X-Roundup-Issue-Files: unnamed
+X-Roundup-Issue-Id: 1
 Content-Transfer-Encoding: quoted-printable
 
 
@@ -1028,6 +1032,7 @@
 X-Roundup-Loop: hello
 X-Roundup-Issue-Status: chatting
 X-Roundup-Issue-Files: unnamed
+X-Roundup-Issue-Id: 1
 Content-Transfer-Encoding: quoted-printable
 
 
@@ -1077,6 +1082,7 @@
 X-Roundup-Loop: hello
 X-Roundup-Issue-Status: chatting
 X-Roundup-Issue-Files: unnamed
+X-Roundup-Issue-Id: 1
 
 
 --utf-8
@@ -1140,6 +1146,7 @@
 X-Roundup-Loop: hello
 X-Roundup-Issue-Status: chatting
 X-Roundup-Issue-Files: unnamed
+X-Roundup-Issue-Id: 1
 
 
 --utf-8
@@ -1199,6 +1206,7 @@
 X-Roundup-Loop: hello
 X-Roundup-Issue-Status: chatting
 X-Roundup-Issue-Files: Fwd: Original email subject.eml
+X-Roundup-Issue-Id: 1
 
 
 --utf-8
@@ -1381,6 +1389,7 @@
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
 X-Roundup-Version: 1.5.1
+X-Roundup-Issue-Id: 1
 
 --===============6077820410007357357==
 MIME-Version: 1.0
@@ -1542,6 +1551,7 @@
 X-Roundup-Loop: hello
 X-Roundup-Issue-Status: chatting
 Content-Transfer-Encoding: quoted-printable
+X-Roundup-Issue-Id: 1
 
 
 Contrary, Mary <mary@test.test> added the comment:
@@ -1591,6 +1601,7 @@
 X-Roundup-Loop: hello
 X-Roundup-Issue-Status: chatting
 Content-Transfer-Encoding: quoted-printable
+X-Roundup-Issue-Id: 1
 
 
 richard <richard@test.test> added the comment:
@@ -1643,6 +1654,7 @@
 X-Roundup-Loop: hello
 X-Roundup-Issue-Status: chatting
 Content-Transfer-Encoding: quoted-printable
+X-Roundup-Issue-Id: 1
 
 richard <richard@test.test> added the comment:
 
@@ -1698,6 +1710,7 @@
 X-Roundup-Loop: hello
 X-Roundup-Issue-Status: chatting
 Content-Transfer-Encoding: quoted-printable
+X-Roundup-Issue-Id: 1
 
 richard <richard@test.test> added the comment:
 
@@ -1745,6 +1758,7 @@
 X-Roundup-Loop: hello
 X-Roundup-Issue-Status: unread
 Content-Transfer-Encoding: quoted-printable
+X-Roundup-Issue-Id: 2
 
 
 New submission from richard <richard@test.test>:
@@ -1809,6 +1823,7 @@
 X-Roundup-Loop: hello
 X-Roundup-Issue-Status: unread
 X-Roundup-Version: 1.3.3
+X-Roundup-Issue-Id: 1
 In-Reply-To: <dummy_test_message_id>
 MIME-Version: 1.0
 Reply-To: Roundup issue tracker
@@ -1839,6 +1854,7 @@
 X-Roundup-Loop: hello
 X-Roundup-Issue-Status: unread
 X-Roundup-Version: 1.3.3
+X-Roundup-Issue-Id: 1
 In-Reply-To: <dummy_test_message_id>
 MIME-Version: 1.0
 Reply-To: Roundup issue tracker
@@ -1896,6 +1912,7 @@
 X-Roundup-Loop: hello
 X-Roundup-Issue-Status: unread
 X-Roundup-Version: 1.3.3
+X-Roundup-Issue-Id: 1
 In-Reply-To: <dummy_test_message_id>
 MIME-Version: 1.0
 Reply-To: Roundup issue tracker
@@ -1946,6 +1963,7 @@
 X-Roundup-Loop: hello
 X-Roundup-Issue-Status: unread
 X-Roundup-Version: 1.3.3
+X-Roundup-Issue-Id: 1
 In-Reply-To: <dummy_test_message_id>
 MIME-Version: 1.0
 Reply-To: Roundup issue tracker
@@ -1998,6 +2016,7 @@
 X-Roundup-Loop: hello
 X-Roundup-Issue-Status: unread
 X-Roundup-Version: 1.3.3
+X-Roundup-Issue-Id: 1
 In-Reply-To: <dummy_test_message_id>
 MIME-Version: 1.0
 Reply-To: Roundup issue tracker
@@ -2049,6 +2068,7 @@
 In-Reply-To: <dummy_test_message_id>
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
+X-Roundup-Issue-Id: 1
 X-Roundup-Issue-Status: chatting
 Content-Transfer-Encoding: quoted-printable
 
@@ -2163,6 +2183,7 @@
 In-Reply-To: <dummy_test_message_id>
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
+X-Roundup-Issue-Id: 1
 X-Roundup-Issue-Status: chatting
 Content-Transfer-Encoding: quoted-printable
 
@@ -2210,6 +2231,7 @@
 In-Reply-To: <dummy_test_message_id>
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
+X-Roundup-Issue-Id: 1
 X-Roundup-Issue-Status: chatting
 Content-Transfer-Encoding: quoted-printable
 
@@ -2248,6 +2270,7 @@
 In-Reply-To: <dummy_test_message_id>
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
+X-Roundup-Issue-Id: 1
 X-Roundup-Issue-Status: chatting
 Content-Transfer-Encoding: quoted-printable
 
@@ -2286,6 +2309,7 @@
 In-Reply-To: <dummy_test_message_id>
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
+X-Roundup-Issue-Id: 1
 X-Roundup-Issue-Status: chatting
 Content-Transfer-Encoding: quoted-printable
 
@@ -2323,6 +2347,7 @@
 In-Reply-To: <dummy_test_message_id>
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
+X-Roundup-Issue-Id: 1
 X-Roundup-Issue-Status: chatting
 Content-Transfer-Encoding: quoted-printable
 
@@ -2360,6 +2385,7 @@
 In-Reply-To: <dummy_test_message_id>
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
+X-Roundup-Issue-Id: 1
 X-Roundup-Issue-Status: chatting
 Content-Transfer-Encoding: quoted-printable
 
@@ -2399,6 +2425,7 @@
 In-Reply-To: <dummy_test_message_id>
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
+X-Roundup-Issue-Id: 1
 X-Roundup-Issue-Status: chatting
 Content-Transfer-Encoding: quoted-printable
 
@@ -2445,6 +2472,7 @@
 In-Reply-To: <dummy_test_message_id>
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
+X-Roundup-Issue-Id: 1
 X-Roundup-Issue-Status: chatting
 Content-Transfer-Encoding: quoted-printable
 
@@ -2546,6 +2574,7 @@
 Message-Id: <dummy_test_message_id>
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
+X-Roundup-Issue-Id: 1
 X-Roundup-Issue-Status: unread
 Content-Transfer-Encoding: quoted-printable
 
@@ -2591,6 +2620,7 @@
 Message-Id: <dummy_test_message_id>
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
+X-Roundup-Issue-Id: 1
 X-Roundup-Issue-Status: unread
 Content-Transfer-Encoding: quoted-printable
 
@@ -2636,6 +2666,7 @@
 Message-Id: <dummy_test_message_id>
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
+X-Roundup-Issue-Id: 1
 X-Roundup-Issue-Status: unread
 Content-Transfer-Encoding: quoted-printable
 
@@ -2883,6 +2914,7 @@
 In-Reply-To: <dummy_test_message_id>
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
+X-Roundup-Issue-Id: 1
 X-Roundup-Issue-Status: chatting
 Content-Transfer-Encoding: quoted-printable
 
@@ -2932,6 +2964,7 @@
 In-Reply-To: <dummy_test_message_id>
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
+X-Roundup-Issue-Id: 1
 X-Roundup-Issue-Status: chatting
 Content-Transfer-Encoding: quoted-printable
 
@@ -2985,6 +3018,7 @@
 In-Reply-To: <dummy_test_message_id>
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
+X-Roundup-Issue-Id: 1
 X-Roundup-Issue-Status: chatting
 Content-Transfer-Encoding: quoted-printable
 
@@ -3061,6 +3095,7 @@
 In-Reply-To: <dummy_test_message_id>
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
+X-Roundup-Issue-Id: 1
 X-Roundup-Issue-Status: chatting
 Content-Transfer-Encoding: quoted-printable
 
@@ -3936,6 +3971,7 @@
 In-Reply-To: <dummy_test_message_id>
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
+X-Roundup-Issue-Id: 1
 X-Roundup-Issue-Status: chatting
 Content-Transfer-Encoding: quoted-printable
 
@@ -3984,6 +4020,7 @@
 In-Reply-To: <dummy_test_message_id>
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
+X-Roundup-Issue-Id: 1
 X-Roundup-Issue-Status: chatting
 X-Roundup-Issue-keyword: Foo, Baz This
 Content-Transfer-Encoding: quoted-printable
@@ -4021,6 +4058,7 @@
 In-Reply-To: <dummy_test_message_id>
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
+X-Roundup-Issue-Id: 1
 X-Roundup-Issue-Status: chatting
 X-Roundup-Issue-Assignedto: mary
 Content-Transfer-Encoding: quoted-printable
@@ -4073,6 +4111,7 @@
 In-Reply-To: <dummy_test_message_id>
 X-Roundup-Name: Roundup issue tracker
 X-Roundup-Loop: hello
+X-Roundup-Issue-Id: 1
 X-Roundup-Issue-Status: chatting
 Content-Transfer-Encoding: quoted-printable
 

Roundup Issue Tracker: http://roundup-tracker.org/