summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-03-25 10:59:05 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-03-25 10:59:05 -0400
commit44ac4f1a78330f029343f31c46e46abc69a25121 (patch)
tree11947eba6412a5b854878a66042356165a0cf54b
parent40c23a568562ec9cc8f81ac8336c257a3b7091e6 (diff)
downloadb4-44ac4f1a78330f029343f31c46e46abc69a25121.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__.py6
1 files changed, 6 insertions, 0 deletions
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):