From: Stephen Finucane Date: Sat, 19 Nov 2016 19:32:10 +0000 (+0000) Subject: views: Include 'List-Id' in mbox X-Git-Tag: v2.0.0-rc1~142 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5f17c49e0b264590061280d307e297fadacbfc7;p=thirdparty%2Fpatchwork.git views: Include 'List-Id' in mbox Signed-off-by: Stephen Finucane Closes-bug: #53 --- diff --git a/patchwork/tests/test_mboxviews.py b/patchwork/tests/test_mboxviews.py index b3f4bf63..31c3b854 100644 --- a/patchwork/tests/test_mboxviews.py +++ b/patchwork/tests/test_mboxviews.py @@ -107,6 +107,11 @@ class MboxHeaderTest(TestCase): header = 'From: John Doe ' self._test_header_passthrough(header) + def test_header_passthrough_listid(self): + """Validate passthrough of 'List-ID' header.""" + header = 'List-Id: Patchwork development ' + 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 b00aeeef..7354f703 100644 --- a/patchwork/views/__init__.py +++ b/patchwork/views/__init__.py @@ -391,7 +391,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: