Mercurial > p > roundup > code
diff test/test_mailgw.py @ 6247:ca0915457761
Handle auto-submitted header on inbound email like bulk.
Part of issue2550564.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Tue, 28 Jul 2020 20:58:04 -0400 |
| parents | ad0ece9cb01b |
| children | 778a9f455067 |
line wrap: on
line diff
--- a/test/test_mailgw.py Tue Jul 28 15:40:00 2020 -0400 +++ b/test/test_mailgw.py Tue Jul 28 20:58:04 2020 -0400 @@ -3590,6 +3590,37 @@ Hi, I'm on holidays, and this is a dumb auto-responder. ''') + def testItsAutoSubmittedStupid(self): + self.assertRaises(IgnoreBulk, self._handle_mail, + '''Content-Type: text/plain; + charset="iso-8859-1" +From: Chef <chef@bork.bork.bork> +Auto-Submitted: Auto-Generated +To: issue_tracker@your.tracker.email.domain.example +Cc: richard@test.test +Message-Id: <dummy_test_message_id> +Subject: Re: [issue] Testing... + +Hi, I'm on holidays, and this is a dumb auto-responder. +''') + + def testItsHumanSubmitted(self): + ''' keep trailing spaces on Auto-submitted header + ''' + self.db.keyword.create(name='Foo') + self._handle_mail('''Content-Type: text/plain; + charset="iso-8859-1" +From: richard <richard@test.test> +To: issue_tracker@your.tracker.email.domain.example +Message-Id: <followup_dummy_id> +In-Reply-To: <dummy_test_message_id> +Auto-submitted: No +Subject: [keyword1] Testing... [name=Bar] + +''') + self.assertEqual(self.db.keyword.get('1', 'name'), 'Bar') + + def testAutoReplyEmailsAreIgnored(self): self.assertRaises(IgnoreBulk, self._handle_mail, '''Content-Type: text/plain;
