[email] Only abort MDA script if no MIME part is usable

This commit is contained in:
maike 2020-07-09 03:16:53 +02:00 committed by dl6tom
parent ae979c37f9
commit c2bdbc6f88

View file

@ -33,11 +33,10 @@ 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)
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]