Mercurial > p > roundup > code
diff roundup/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 | 80915fd9ad24 |
| children | 14c9284a8bad |
line wrap: on
line diff
--- a/roundup/mailgw.py Tue Jul 28 15:40:00 2020 -0400 +++ b/roundup/mailgw.py Tue Jul 28 20:58:04 2020 -0400 @@ -535,10 +535,18 @@ ''' Check to see if message can be safely ignored: detect loops and Precedence: Bulk, or Microsoft Outlook autoreplies + Auto-Submitted not equal to no, so auto-generated, + auto-replied and auto-notified are dropped. rstrip + auto-submitted value because trailing comment/whitespace + is allowed per RFC3834. Note that we only handle whitespace. + Lowercase the value as references say No and no as possible + values. ''' if self.message.get_header('x-roundup-loop', ''): raise IgnoreLoop if (self.message.get_header('precedence', '') == 'bulk' + or self.message.get_header('auto-submitted', 'no').rstrip().lower() \ + != 'no' or self.subject.lower().find("autoreply") > 0): raise IgnoreBulk
