diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-03-25 10:59:05 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-03-25 11:00:39 -0400 |
commit | 088064c0b88966e5d3d7b488e27c4ea0092c9d73 (patch) | |
tree | 49c977ab6054f0d1f54a46475fc644a7180434f8 | |
parent | 9b7916774c5536806a27d12dcddefb87e62cedfc (diff) | |
download | b4-088064c0b88966e5d3d7b488e27c4ea0092c9d73.tar.gz |
Ignore messages without plaintext content
When a message contains no text/plain contents, then it's not anything
we can use and we should toss them out early.
Reported-by: Jason Donenfeld <Jason@zx2c4.com>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | b4/__init__.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/b4/__init__.py b/b4/__init__.py index 24451d4..16aa2c6 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -572,6 +572,12 @@ class LoreMessage: if diffre.search(payload): self.body = payload + if self.body is None: + # Woah, we didn't find any usable parts + logger.debug(' No plain or patch parts found in message') + logger.info(' Not plaintext: %s', self.full_subject) + return + if diffstatre.search(self.body): self.has_diffstat = True if diffre.search(self.body): |