3.8.1 - Better handling of .msg files when msgconvert is not installed

This commit is contained in:
Sean Whalen
2018-08-27 09:04:08 -04:00
parent ca0397c331
commit 22c2e8799a
3 changed files with 13 additions and 3 deletions

View File

@@ -1,3 +1,8 @@
3.8.1
-----
- Better handling of `.msg` files when `msgconvert` is not installed
3.8.0
-----

View File

@@ -43,7 +43,7 @@ import imapclient.exceptions
import dateparser
import mailparser
__version__ = "3.8.0"
__version__ = "3.8.1"
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
@@ -933,7 +933,7 @@ def parse_report_email(input_, nameservers=None, timeout=6.0):
with open(eml_path, "rb") as eml_file:
rfc822 = eml_file.read()
except FileNotFoundError as e:
raise RuntimeError(
raise FileNotFoundError(
"Error running msgconvert. Please ensure it is installed\n"
"sudo apt install libemail-outlook-message-perl\n"
"https://github.com/mvz/email-outlook-message-perl\n\n"
@@ -1017,6 +1017,11 @@ def parse_report_email(input_, nameservers=None, timeout=6.0):
except (TypeError, ValueError, binascii.Error):
pass
except FileNotFoundError as e:
error = 'Unable to parse message with subject "{0}": {1}' .format(
subject, e)
raise InvalidDMARCReport(error)
if result is None:
error = 'Message with subject "{0}" is ' \
'not a valid DMARC report'.format(subject)

View File

@@ -14,7 +14,7 @@ from setuptools import setup
from codecs import open
from os import path
__version__ = "3.8.0"
__version__ = "3.8.1"
description = "A Python package and CLI for parsing aggregate and " \
"forensic DMARC reports"