From 44ac4f1a78330f029343f31c46e46abc69a25121 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(+) (limited to 'b4') diff --git a/b4/__init__.py b/b4/__init__.py index ef81ffc..850cce1 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