Skip to content

Commit dc6baea

Browse files
committed
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.
1 parent 4e92dc9 commit dc6baea

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ Features:
8282
limit mechanism added for web page logins. Default is 3 login
8383
attempts/minute for a user. After which one login attempt every 20
8484
seconds can be done. (John Rouillard)
85+
- issue2551043: Add X-Roundup-issue-id email header. Add a new header
86+
to make it easier to filter notification emails without having to
87+
parse the subject line. (John Rouillard)
8588

8689
Fixed:
8790

roundup/roundupdb.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,16 @@ def send_message(self, issueid, msgid, note, sendto, from_address=None,
595595
except UnicodeError:
596596
message[header] = Header(values, charset)
597597

598+
# Add header for main id number to make filtering
599+
# email easier than extracting from subject line.
600+
header = "X-Roundup-%s-Id"%(self.classname)
601+
values = issueid
602+
try:
603+
values.encode('ascii')
604+
message[header] = values
605+
except UnicodeError:
606+
message[header] = Header(values, charset)
607+
598608
if not inreplyto:
599609
# Default the reply to the first message
600610
msgs = self.get(issueid, 'messages')

test/test_mailgw.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,7 @@ def testNewIssueAuthMsg(self):
559559
X-Roundup-Name: Roundup issue tracker
560560
X-Roundup-Loop: hello
561561
X-Roundup-Issue-Status: unread
562+
X-Roundup-Issue-Id: 1
562563
Content-Transfer-Encoding: quoted-printable
563564
564565
@@ -605,6 +606,7 @@ def testNewIssueNoAuthorInfo(self):
605606
X-Roundup-Name: Roundup issue tracker
606607
X-Roundup-Loop: hello
607608
X-Roundup-Issue-Status: unread
609+
X-Roundup-Issue-Id: 1
608610
Content-Transfer-Encoding: quoted-printable
609611
610612
This is a test submission of a new issue.
@@ -648,6 +650,7 @@ def testNewIssueNoAuthorEmail(self):
648650
X-Roundup-Name: Roundup issue tracker
649651
X-Roundup-Loop: hello
650652
X-Roundup-Issue-Status: unread
653+
X-Roundup-Issue-Id: 1
651654
Content-Transfer-Encoding: quoted-printable
652655
653656
New submission from Bork, Chef:
@@ -977,6 +980,7 @@ def testMultipartCharsetUTF8NoAttach(self):
977980
X-Roundup-Loop: hello
978981
X-Roundup-Issue-Status: chatting
979982
X-Roundup-Issue-Files: unnamed
983+
X-Roundup-Issue-Id: 1
980984
Content-Transfer-Encoding: quoted-printable
981985
982986
@@ -1028,6 +1032,7 @@ def testMultipartCharsetLatin1NoAttach(self):
10281032
X-Roundup-Loop: hello
10291033
X-Roundup-Issue-Status: chatting
10301034
X-Roundup-Issue-Files: unnamed
1035+
X-Roundup-Issue-Id: 1
10311036
Content-Transfer-Encoding: quoted-printable
10321037
10331038
@@ -1077,6 +1082,7 @@ def testMultipartCharsetUTF8AttachFile(self):
10771082
X-Roundup-Loop: hello
10781083
X-Roundup-Issue-Status: chatting
10791084
X-Roundup-Issue-Files: unnamed
1085+
X-Roundup-Issue-Id: 1
10801086
10811087
10821088
--utf-8
@@ -1140,6 +1146,7 @@ def testMultipartCharsetLatin1AttachFile(self):
11401146
X-Roundup-Loop: hello
11411147
X-Roundup-Issue-Status: chatting
11421148
X-Roundup-Issue-Files: unnamed
1149+
X-Roundup-Issue-Id: 1
11431150
11441151
11451152
--utf-8
@@ -1199,6 +1206,7 @@ def testMultipartRFC822(self):
11991206
X-Roundup-Loop: hello
12001207
X-Roundup-Issue-Status: chatting
12011208
X-Roundup-Issue-Files: Fwd: Original email subject.eml
1209+
X-Roundup-Issue-Id: 1
12021210
12031211
12041212
--utf-8
@@ -1381,6 +1389,7 @@ def testMultipartTextifyHTML(self):
13811389
X-Roundup-Name: Roundup issue tracker
13821390
X-Roundup-Loop: hello
13831391
X-Roundup-Version: 1.5.1
1392+
X-Roundup-Issue-Id: 1
13841393
13851394
--===============6077820410007357357==
13861395
MIME-Version: 1.0
@@ -1542,6 +1551,7 @@ def testSimpleFollowup(self):
15421551
X-Roundup-Loop: hello
15431552
X-Roundup-Issue-Status: chatting
15441553
Content-Transfer-Encoding: quoted-printable
1554+
X-Roundup-Issue-Id: 1
15451555
15461556
15471557
Contrary, Mary <[email protected]> added the comment:
@@ -1591,6 +1601,7 @@ def testFollowup(self):
15911601
X-Roundup-Loop: hello
15921602
X-Roundup-Issue-Status: chatting
15931603
Content-Transfer-Encoding: quoted-printable
1604+
X-Roundup-Issue-Id: 1
15941605
15951606
15961607
richard <[email protected]> added the comment:
@@ -1643,6 +1654,7 @@ def testFollowupNoSubjectChange(self):
16431654
X-Roundup-Loop: hello
16441655
X-Roundup-Issue-Status: chatting
16451656
Content-Transfer-Encoding: quoted-printable
1657+
X-Roundup-Issue-Id: 1
16461658
16471659
richard <[email protected]> added the comment:
16481660
@@ -1698,6 +1710,7 @@ def testFollowupExplicitSubjectChange(self):
16981710
X-Roundup-Loop: hello
16991711
X-Roundup-Issue-Status: chatting
17001712
Content-Transfer-Encoding: quoted-printable
1713+
X-Roundup-Issue-Id: 1
17011714
17021715
richard <[email protected]> added the comment:
17031716
@@ -1745,6 +1758,7 @@ def testNosyGeneration(self):
17451758
X-Roundup-Loop: hello
17461759
X-Roundup-Issue-Status: unread
17471760
Content-Transfer-Encoding: quoted-printable
1761+
X-Roundup-Issue-Id: 2
17481762
17491763
17501764
New submission from richard <[email protected]>:
@@ -1809,6 +1823,7 @@ def testNosyMessageCcBccEtc(self):
18091823
X-Roundup-Loop: hello
18101824
X-Roundup-Issue-Status: unread
18111825
X-Roundup-Version: 1.3.3
1826+
X-Roundup-Issue-Id: 1
18121827
In-Reply-To: <dummy_test_message_id>
18131828
MIME-Version: 1.0
18141829
Reply-To: Roundup issue tracker
@@ -1839,6 +1854,7 @@ def testNosyMessageCcBccEtc(self):
18391854
X-Roundup-Loop: hello
18401855
X-Roundup-Issue-Status: unread
18411856
X-Roundup-Version: 1.3.3
1857+
X-Roundup-Issue-Id: 1
18421858
In-Reply-To: <dummy_test_message_id>
18431859
MIME-Version: 1.0
18441860
Reply-To: Roundup issue tracker
@@ -1896,6 +1912,7 @@ def note_filter(original_note, issue_id, db, newvalues, oldvalues):
18961912
X-Roundup-Loop: hello
18971913
X-Roundup-Issue-Status: unread
18981914
X-Roundup-Version: 1.3.3
1915+
X-Roundup-Issue-Id: 1
18991916
In-Reply-To: <dummy_test_message_id>
19001917
MIME-Version: 1.0
19011918
Reply-To: Roundup issue tracker
@@ -1946,6 +1963,7 @@ def testPropertyChangeOnly(self):
19461963
X-Roundup-Loop: hello
19471964
X-Roundup-Issue-Status: unread
19481965
X-Roundup-Version: 1.3.3
1966+
X-Roundup-Issue-Id: 1
19491967
In-Reply-To: <dummy_test_message_id>
19501968
MIME-Version: 1.0
19511969
Reply-To: Roundup issue tracker
@@ -1998,6 +2016,7 @@ def testNosyMessageSettingSubject(self):
19982016
X-Roundup-Loop: hello
19992017
X-Roundup-Issue-Status: unread
20002018
X-Roundup-Version: 1.3.3
2019+
X-Roundup-Issue-Id: 1
20012020
In-Reply-To: <dummy_test_message_id>
20022021
MIME-Version: 1.0
20032022
Reply-To: Roundup issue tracker
@@ -2049,6 +2068,7 @@ def testFollowupTitleMatch(self):
20492068
In-Reply-To: <dummy_test_message_id>
20502069
X-Roundup-Name: Roundup issue tracker
20512070
X-Roundup-Loop: hello
2071+
X-Roundup-Issue-Id: 1
20522072
X-Roundup-Issue-Status: chatting
20532073
Content-Transfer-Encoding: quoted-printable
20542074
@@ -2163,6 +2183,7 @@ def testFollowupNosyAuthor(self):
21632183
In-Reply-To: <dummy_test_message_id>
21642184
X-Roundup-Name: Roundup issue tracker
21652185
X-Roundup-Loop: hello
2186+
X-Roundup-Issue-Id: 1
21662187
X-Roundup-Issue-Status: chatting
21672188
Content-Transfer-Encoding: quoted-printable
21682189
@@ -2210,6 +2231,7 @@ def testFollowupNosyRecipients(self):
22102231
In-Reply-To: <dummy_test_message_id>
22112232
X-Roundup-Name: Roundup issue tracker
22122233
X-Roundup-Loop: hello
2234+
X-Roundup-Issue-Id: 1
22132235
X-Roundup-Issue-Status: chatting
22142236
Content-Transfer-Encoding: quoted-printable
22152237
@@ -2248,6 +2270,7 @@ def testFollowupNosyAuthorAndCopy(self):
22482270
In-Reply-To: <dummy_test_message_id>
22492271
X-Roundup-Name: Roundup issue tracker
22502272
X-Roundup-Loop: hello
2273+
X-Roundup-Issue-Id: 1
22512274
X-Roundup-Issue-Status: chatting
22522275
Content-Transfer-Encoding: quoted-printable
22532276
@@ -2286,6 +2309,7 @@ def testFollowupNosyAuthorNosyCopy(self):
22862309
In-Reply-To: <dummy_test_message_id>
22872310
X-Roundup-Name: Roundup issue tracker
22882311
X-Roundup-Loop: hello
2312+
X-Roundup-Issue-Id: 1
22892313
X-Roundup-Issue-Status: chatting
22902314
Content-Transfer-Encoding: quoted-printable
22912315
@@ -2323,6 +2347,7 @@ def testFollowupNoNosyAuthor(self):
23232347
In-Reply-To: <dummy_test_message_id>
23242348
X-Roundup-Name: Roundup issue tracker
23252349
X-Roundup-Loop: hello
2350+
X-Roundup-Issue-Id: 1
23262351
X-Roundup-Issue-Status: chatting
23272352
Content-Transfer-Encoding: quoted-printable
23282353
@@ -2360,6 +2385,7 @@ def testFollowupNoNosyAuthorNoCopy(self):
23602385
In-Reply-To: <dummy_test_message_id>
23612386
X-Roundup-Name: Roundup issue tracker
23622387
X-Roundup-Loop: hello
2388+
X-Roundup-Issue-Id: 1
23632389
X-Roundup-Issue-Status: chatting
23642390
Content-Transfer-Encoding: quoted-printable
23652391
@@ -2399,6 +2425,7 @@ def testFollowupNoNosyAuthorButCopy(self):
23992425
In-Reply-To: <dummy_test_message_id>
24002426
X-Roundup-Name: Roundup issue tracker
24012427
X-Roundup-Loop: hello
2428+
X-Roundup-Issue-Id: 1
24022429
X-Roundup-Issue-Status: chatting
24032430
Content-Transfer-Encoding: quoted-printable
24042431
@@ -2445,6 +2472,7 @@ def testFollowupNoNosyRecipients(self):
24452472
In-Reply-To: <dummy_test_message_id>
24462473
X-Roundup-Name: Roundup issue tracker
24472474
X-Roundup-Loop: hello
2475+
X-Roundup-Issue-Id: 1
24482476
X-Roundup-Issue-Status: chatting
24492477
Content-Transfer-Encoding: quoted-printable
24502478
@@ -2546,6 +2574,7 @@ def testNosyReplytoTracker(self):
25462574
Message-Id: <dummy_test_message_id>
25472575
X-Roundup-Name: Roundup issue tracker
25482576
X-Roundup-Loop: hello
2577+
X-Roundup-Issue-Id: 1
25492578
X-Roundup-Issue-Status: unread
25502579
Content-Transfer-Encoding: quoted-printable
25512580
@@ -2591,6 +2620,7 @@ def testNosyReplytoSomeaddress(self):
25912620
Message-Id: <dummy_test_message_id>
25922621
X-Roundup-Name: Roundup issue tracker
25932622
X-Roundup-Loop: hello
2623+
X-Roundup-Issue-Id: 1
25942624
X-Roundup-Issue-Status: unread
25952625
Content-Transfer-Encoding: quoted-printable
25962626
@@ -2636,6 +2666,7 @@ def testNosyReplytoAuthor(self):
26362666
Message-Id: <dummy_test_message_id>
26372667
X-Roundup-Name: Roundup issue tracker
26382668
X-Roundup-Loop: hello
2669+
X-Roundup-Issue-Id: 1
26392670
X-Roundup-Issue-Status: unread
26402671
Content-Transfer-Encoding: quoted-printable
26412672
@@ -2883,6 +2914,7 @@ def testEnc01(self):
28832914
In-Reply-To: <dummy_test_message_id>
28842915
X-Roundup-Name: Roundup issue tracker
28852916
X-Roundup-Loop: hello
2917+
X-Roundup-Issue-Id: 1
28862918
X-Roundup-Issue-Status: chatting
28872919
Content-Transfer-Encoding: quoted-printable
28882920
@@ -2932,6 +2964,7 @@ def testEncNonUTF8(self):
29322964
In-Reply-To: <dummy_test_message_id>
29332965
X-Roundup-Name: Roundup issue tracker
29342966
X-Roundup-Loop: hello
2967+
X-Roundup-Issue-Id: 1
29352968
X-Roundup-Issue-Status: chatting
29362969
Content-Transfer-Encoding: quoted-printable
29372970
@@ -2985,6 +3018,7 @@ def testMultipartEnc01(self):
29853018
In-Reply-To: <dummy_test_message_id>
29863019
X-Roundup-Name: Roundup issue tracker
29873020
X-Roundup-Loop: hello
3021+
X-Roundup-Issue-Id: 1
29883022
X-Roundup-Issue-Status: chatting
29893023
Content-Transfer-Encoding: quoted-printable
29903024
@@ -3061,6 +3095,7 @@ def testFollowupStupidQuoting(self):
30613095
In-Reply-To: <dummy_test_message_id>
30623096
X-Roundup-Name: Roundup issue tracker
30633097
X-Roundup-Loop: hello
3098+
X-Roundup-Issue-Id: 1
30643099
X-Roundup-Issue-Status: chatting
30653100
Content-Transfer-Encoding: quoted-printable
30663101
@@ -3936,6 +3971,7 @@ def testSecurityMessagePermissionContent(self):
39363971
In-Reply-To: <dummy_test_message_id>
39373972
X-Roundup-Name: Roundup issue tracker
39383973
X-Roundup-Loop: hello
3974+
X-Roundup-Issue-Id: 1
39393975
X-Roundup-Issue-Status: chatting
39403976
Content-Transfer-Encoding: quoted-printable
39413977
@@ -3984,6 +4020,7 @@ def testSpacesAroundMultilinkPropertyValue(self):
39844020
In-Reply-To: <dummy_test_message_id>
39854021
X-Roundup-Name: Roundup issue tracker
39864022
X-Roundup-Loop: hello
4023+
X-Roundup-Issue-Id: 1
39874024
X-Roundup-Issue-Status: chatting
39884025
X-Roundup-Issue-keyword: Foo, Baz This
39894026
Content-Transfer-Encoding: quoted-printable
@@ -4021,6 +4058,7 @@ def testmsgHeaderPropertyAssignedto(self):
40214058
In-Reply-To: <dummy_test_message_id>
40224059
X-Roundup-Name: Roundup issue tracker
40234060
X-Roundup-Loop: hello
4061+
X-Roundup-Issue-Id: 1
40244062
X-Roundup-Issue-Status: chatting
40254063
X-Roundup-Issue-Assignedto: mary
40264064
Content-Transfer-Encoding: quoted-printable
@@ -4073,6 +4111,7 @@ def testmsgHeaderPropertyEmptyString(self):
40734111
In-Reply-To: <dummy_test_message_id>
40744112
X-Roundup-Name: Roundup issue tracker
40754113
X-Roundup-Loop: hello
4114+
X-Roundup-Issue-Id: 1
40764115
X-Roundup-Issue-Status: chatting
40774116
Content-Transfer-Encoding: quoted-printable
40784117

0 commit comments

Comments
 (0)