diff mbox

[2/2] views: Include 'List-Id' in mbox

Message ID 1479583930-19564-2-git-send-email-stephen@that.guru
State Accepted
Headers show

Commit Message

Stephen Finucane Nov. 19, 2016, 7:32 p.m. UTC
Signed-off-by: Stephen Finucane <stephen@that.guru>
Closes-bug: #53
---
 patchwork/tests/test_mboxviews.py | 5 +++++
 patchwork/views/__init__.py       | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

Comments

Stephen Finucane Dec. 18, 2016, 10:40 p.m. UTC | #1
On Sat, 2016-11-19 at 19:32 +0000, Stephen Finucane wrote:
> Signed-off-by: Stephen Finucane <stephen@that.guru>
> Closes-bug: #53

Applied.
diff mbox

Patch

diff --git a/patchwork/tests/test_mboxviews.py b/patchwork/tests/test_mboxviews.py
index b3f4bf6..31c3b85 100644
--- a/patchwork/tests/test_mboxviews.py
+++ b/patchwork/tests/test_mboxviews.py
@@ -107,6 +107,11 @@  class MboxHeaderTest(TestCase):
         header = 'From: John Doe <john@doe.com>'
         self._test_header_passthrough(header)
 
+    def test_header_passthrough_listid(self):
+        """Validate passthrough of 'List-ID' header."""
+        header = 'List-Id: Patchwork development <patchwork.lists.ozlabs.org>'
+        self._test_header_passthrough(header)
+
     def test_patchwork_id_header(self):
         """Validate inclusion of generated 'X-Patchwork-Id' header."""
         patch = create_patch()
diff --git a/patchwork/views/__init__.py b/patchwork/views/__init__.py
index 5dc3a0e..215c728 100644
--- a/patchwork/views/__init__.py
+++ b/patchwork/views/__init__.py
@@ -393,7 +393,7 @@  def patch_to_mbox(patch):
     mail['Message-Id'] = patch.msgid
     mail.set_unixfrom('From patchwork ' + patch.date.ctime())
 
-    copied_headers = ['To', 'Cc', 'Date', 'From']
+    copied_headers = ['To', 'Cc', 'Date', 'From', 'List-Id']
     orig_headers = HeaderParser().parsestr(str(patch.headers))
     for header in copied_headers:
         if header in orig_headers: