[email] Only abort MDA script if no MIME part is usable
This commit is contained in:
parent
ae979c37f9
commit
c2bdbc6f88
|
@ -33,11 +33,10 @@ def main():
|
||||||
text = part.get_body(('plain',))
|
text = part.get_body(('plain',))
|
||||||
if not text:
|
if not text:
|
||||||
text = re.sub(r'<[^>]*>', '', part.get_body(('html',)))
|
text = re.sub(r'<[^>]*>', '', part.get_body(('html',)))
|
||||||
if not text:
|
|
||||||
logger.error('No suitable message body')
|
|
||||||
exit(0)
|
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.info("No Body in this message part", exc_info=True)
|
logger.info("No Body in this message part", exc_info=True)
|
||||||
|
if not text:
|
||||||
|
logger.error('No suitable message body')
|
||||||
exit(0)
|
exit(0)
|
||||||
# extract hood name from the envelope recipient address
|
# extract hood name from the envelope recipient address
|
||||||
hood_name = args.recipient_address.split('@')[0]
|
hood_name = args.recipient_address.split('@')[0]
|
||||||
|
|
Loading…
Reference in a new issue