diff options
author | Mark Sapiro <mark@msapiro.net> | 2017-03-04 13:21:54 -0800 |
---|---|---|
committer | Mark Sapiro <mark@msapiro.net> | 2017-03-04 13:21:54 -0800 |
commit | 2c34348878f40b9a0fe9784baf89d02cb3dac252 (patch) | |
tree | 925112e587424302416a722c2c6f22ad34c011a1 | |
parent | b3b302042d527deeeb87605ad22e7185d0beae20 (diff) | |
download | mailman2-2c34348878f40b9a0fe9784baf89d02cb3dac252.tar.gz mailman2-2c34348878f40b9a0fe9784baf89d02cb3dac252.tar.xz mailman2-2c34348878f40b9a0fe9784baf89d02cb3dac252.zip |
Ensure added headers and footers have a trailing new-line.
-rw-r--r-- | Mailman/Handlers/Decorate.py | 3 | ||||
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | tests/test_handlers.py | 17 |
3 files changed, 18 insertions, 5 deletions
diff --git a/Mailman/Handlers/Decorate.py b/Mailman/Handlers/Decorate.py index 69e86d5b..de8b44e6 100644 --- a/Mailman/Handlers/Decorate.py +++ b/Mailman/Handlers/Decorate.py @@ -240,4 +240,7 @@ def decorate(mlist, template, what, extradict=None): except (ValueError, TypeError), e: syslog('error', 'Exception while calculating %s:\n%s', what, e) text = template + # Ensure text ends with new-line + if not text.endswith('\n'): + text += '\n' return text @@ -26,6 +26,9 @@ Here is a history of user visible changes to Mailman. Bug fixes and other patches + - Ensured that added message and digest headers and footers always have + a terminating new-line. (LP: #1670033) + - Fixed an uncaught TypeError in the subscribe CGI. (LP: #1667215) - Added recognition for a newly seen mailEnable bounce. diff --git a/tests/test_handlers.py b/tests/test_handlers.py index 049ac35e..878fd84a 100644 --- a/tests/test_handlers.py +++ b/tests/test_handlers.py @@ -886,7 +886,8 @@ Here is a message. self.assertEqual(msg.get_payload(), """\ header Here is a message. -footer""") +footer +""") def test_no_multipart_template(self): mlist = self._mlist @@ -902,7 +903,8 @@ Here is a message. self.assertEqual(msg.get_payload(), """\ XTest header Here is a message. -XTest footer""") +XTest footer +""") def test_no_multipart_type_error(self): mlist = self._mlist @@ -918,7 +920,8 @@ Here is a message. self.assertEqual(msg.get_payload(), """\ %(real_name) header Here is a message. -%(real_name) footer""") +%(real_name) footer +""") def test_no_multipart_value_error(self): mlist = self._mlist @@ -935,7 +938,8 @@ Here is a message. self.assertEqual(msg.get_payload(), """\ %(real_name)p header Here is a message. -%(real_name)p footer""") +%(real_name)p footer +""") def test_no_multipart_missing_key(self): mlist = self._mlist @@ -950,7 +954,8 @@ Here is a message. self.assertEqual(msg.get_payload(), """\ %(spooge)s header Here is a message. -%(spooge)s footer""") +%(spooge)s footer +""") def test_multipart(self): eq = self.ndiffAssertEqual @@ -984,6 +989,7 @@ Content-Transfer-Encoding: 7bit Content-Disposition: inline header + --BOUNDARY From: aperson@dom.ain @@ -1001,6 +1007,7 @@ Content-Transfer-Encoding: 7bit Content-Disposition: inline footer + --BOUNDARY-- """) |