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

Stephen Finucane stephen at that.guru
Sun Nov 20 06:32:10 AEDT 2016


Signed-off-by: Stephen Finucane <stephen at that.guru>
Closes-bug: #53
---
 patchwork/tests/test_mboxviews.py | 5 +++++
 patchwork/views/__init__.py       | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

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 at 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:
-- 
2.7.4



More information about the Patchwork mailing list