From c2bdbc6f88e6a01d23f22b92d8c8ee6b87fd8b95 Mon Sep 17 00:00:00 2001 From: maike Date: Thu, 9 Jul 2020 03:16:53 +0200 Subject: [PATCH] [email] Only abort MDA script if no MIME part is usable --- kibicara/kibicara_mda.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kibicara/kibicara_mda.py b/kibicara/kibicara_mda.py index ccaa018..906e2a6 100644 --- a/kibicara/kibicara_mda.py +++ b/kibicara/kibicara_mda.py @@ -33,12 +33,11 @@ def main(): text = part.get_body(('plain',)) if not text: text = re.sub(r'<[^>]*>', '', part.get_body(('html',))) - if not text: - logger.error('No suitable message body') - exit(0) except Exception: logger.info("No Body in this message part", exc_info=True) - exit(0) + if not text: + logger.error('No suitable message body') + exit(0) # extract hood name from the envelope recipient address hood_name = args.recipient_address.split('@')[0] hood = await Hood.objects.get(name=hood_name)