diff test/test_mailgw.py @ 5045:a46d5d0fd5f8

Fix issue1615201: Added a new configuration option EMAIL_KEEP_REAL_FROM which makes the mail gateway ignore a Resent-From:-header and use the real From:-header of the original author for further processing of the message. Setting this option to 'yes' restores the original behaviour of Roundup before the change in version 0.7.0 where the processing of Resent-From: was added unconditionally.
author Peter Funk <pf@artcom-gmbh.de>
date Fri, 18 Mar 2016 16:18:20 +0100
parents c977f3530944
children 2706b66675bf
line wrap: on
line diff
--- a/test/test_mailgw.py	Wed Feb 11 00:44:16 2015 +1100
+++ b/test/test_mailgw.py	Fri Mar 18 16:18:20 2016 +0100
@@ -2586,6 +2586,25 @@
         self.assertEqual(l, [self.richard_id, self.mary_id])
         return nodeid
 
+    def testResentFromSwitchedOff(self):
+        self.instance.config.EMAIL_KEEP_REAL_FROM = 'yes'
+        nodeid = self._handle_mail('''Content-Type: text/plain;
+  charset="iso-8859-1"
+From: Chef <chef@bork.bork.bork>
+Resent-From: mary <mary@test.test>
+To: issue_tracker@your.tracker.email.domain.example
+Cc: richard@test.test
+Message-Id: <dummy_test_message_id>
+Subject: [issue] Testing...
+
+This is a test submission of a new issue.
+''')
+        assert not os.path.exists(SENDMAILDEBUG)
+        l = self.db.issue.get(nodeid, 'nosy')
+        l.sort()
+        self.assertEqual(l, [self.chef_id, self.richard_id])
+        return nodeid
+
     def testDejaVu(self):
         self.assertRaises(IgnoreLoop, self._handle_mail,
             '''Content-Type: text/plain;

Roundup Issue Tracker: http://roundup-tracker.org/