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