From 088064c0b88966e5d3d7b488e27c4ea0092c9d73 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Wed, 25 Mar 2020 10:59:05 -0400 Subject: 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 Signed-off-by: Konstantin Ryabitsev --- b4/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) 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): -- cgit v1.2.3