From b3b302042d527deeeb87605ad22e7185d0beae20 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Wed, 22 Feb 2017 22:05:56 -0800 Subject: Fixed an uncaught TypeError in the subscribe CGI. --- Mailman/Cgi/subscribe.py | 2 +- NEWS | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Mailman/Cgi/subscribe.py b/Mailman/Cgi/subscribe.py index 36d25fa2..b2f8925e 100755 --- a/Mailman/Cgi/subscribe.py +++ b/Mailman/Cgi/subscribe.py @@ -185,7 +185,7 @@ def process_form(mlist, doc, cgidata, lang): if digestflag: try: digest = int(digestflag) - except ValueError: + except (TypeError, ValueError): digest = 0 else: digest = mlist.digest_is_default diff --git a/NEWS b/NEWS index dc9c155a..fde02dd4 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,8 @@ Here is a history of user visible changes to Mailman. Bug fixes and other patches + - Fixed an uncaught TypeError in the subscribe CGI. (LP: #1667215) + - Added recognition for a newly seen mailEnable bounce. - Fixed an uncaught NotAMemberError when a member is removed before a -- cgit v1.2.3 From 2c34348878f40b9a0fe9784baf89d02cb3dac252 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Sat, 4 Mar 2017 13:21:54 -0800 Subject: Ensure added headers and footers have a trailing new-line. --- Mailman/Handlers/Decorate.py | 3 +++ NEWS | 3 +++ 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 diff --git a/NEWS b/NEWS index fde02dd4..0be02873 100644 --- a/NEWS +++ b/NEWS @@ -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-- """) -- cgit v1.2.3 From 956a56fbded78f34ea06e561de5930463e94098b Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Sun, 5 Mar 2017 21:25:38 -0800 Subject: Updated test_message.py to account for optional Sender: and VERP. --- tests/test_message.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/test_message.py b/tests/test_message.py index 00f524f4..0d2cb622 100644 --- a/tests/test_message.py +++ b/tests/test_message.py @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2010 by the Free Software Foundation, Inc. +# Copyright (C) 2001-2017 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -51,8 +51,14 @@ class TestSentMessage1(EmailBase): msgid = qmsg['message-id'] unless(msgid.startswith('')) - eq(qmsg['sender'], '_xtest-bounces@dom.ain') - eq(qmsg['errors-to'], '_xtest-bounces@dom.ain') + # The Sender: header is optional and addresses can be VERPed + if self._mlist.include_sender_header: + sender = qmsg['sender'] + unless(sender.startswith('"_xtest" <_xtest-bounces')) + unless(sender.endswith('@dom.ain>')) + eto = qmsg['errors-to'] + unless(eto.startswith('_xtest-bounces')) + unless(eto.endswith('@dom.ain')) eq(qmsg['x-beenthere'], '_xtest@dom.ain') eq(qmsg['x-mailman-version'], Version.VERSION) eq(qmsg['precedence'], 'bulk') -- cgit v1.2.3 From 94a83e81638064e6d70fafe02a9b14b8866635e3 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Mon, 6 Mar 2017 12:34:18 -0800 Subject: Fixed a long standing typo. --- Mailman/Defaults.py.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in index fb2b26b6..6ad5d7ab 100755 --- a/Mailman/Defaults.py.in +++ b/Mailman/Defaults.py.in @@ -1,6 +1,6 @@ # -*- python -*- -# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -185,7 +185,7 @@ VIRTUAL_HOST_OVERVIEW = On # omitted it defaults to urlhost with the first name stripped off, e.g. # # add_virtualhost('www.dom.ain') -# VIRTUAL_HOST['www.dom.ain'] +# VIRTUAL_HOSTS['www.dom.ain'] # ==> 'dom.ain' # def add_virtualhost(urlhost, emailhost=None): -- cgit v1.2.3