Mercurial > p > roundup > code
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 5044:dce3cfe7ec61 | 5045:a46d5d0fd5f8 |
|---|---|
| 2582 ''') | 2582 ''') |
| 2583 assert not os.path.exists(SENDMAILDEBUG) | 2583 assert not os.path.exists(SENDMAILDEBUG) |
| 2584 l = self.db.issue.get(nodeid, 'nosy') | 2584 l = self.db.issue.get(nodeid, 'nosy') |
| 2585 l.sort() | 2585 l.sort() |
| 2586 self.assertEqual(l, [self.richard_id, self.mary_id]) | 2586 self.assertEqual(l, [self.richard_id, self.mary_id]) |
| 2587 return nodeid | |
| 2588 | |
| 2589 def testResentFromSwitchedOff(self): | |
| 2590 self.instance.config.EMAIL_KEEP_REAL_FROM = 'yes' | |
| 2591 nodeid = self._handle_mail('''Content-Type: text/plain; | |
| 2592 charset="iso-8859-1" | |
| 2593 From: Chef <chef@bork.bork.bork> | |
| 2594 Resent-From: mary <mary@test.test> | |
| 2595 To: issue_tracker@your.tracker.email.domain.example | |
| 2596 Cc: richard@test.test | |
| 2597 Message-Id: <dummy_test_message_id> | |
| 2598 Subject: [issue] Testing... | |
| 2599 | |
| 2600 This is a test submission of a new issue. | |
| 2601 ''') | |
| 2602 assert not os.path.exists(SENDMAILDEBUG) | |
| 2603 l = self.db.issue.get(nodeid, 'nosy') | |
| 2604 l.sort() | |
| 2605 self.assertEqual(l, [self.chef_id, self.richard_id]) | |
| 2587 return nodeid | 2606 return nodeid |
| 2588 | 2607 |
| 2589 def testDejaVu(self): | 2608 def testDejaVu(self): |
| 2590 self.assertRaises(IgnoreLoop, self._handle_mail, | 2609 self.assertRaises(IgnoreLoop, self._handle_mail, |
| 2591 '''Content-Type: text/plain; | 2610 '''Content-Type: text/plain; |
