Downgrade mailparser to 3.5.1

This commit is contained in:
Sean Whalen
2018-10-11 15:59:23 -04:00
parent e138c5467d
commit b335edacaf
3 changed files with 6 additions and 5 deletions

View File

@@ -176,6 +176,7 @@ def human_timestamp_to_datetime(human_timestamp):
Returns:
DateTime: The converted timestamp
"""
human_timestamp = human_timestamp.replace("T", " ")
return datetime.strptime(human_timestamp, "%Y-%m-%d %H:%M:%S")
@@ -189,6 +190,7 @@ def human_timestamp_to_timestamp(human_timestamp):
Returns:
float: The converted timestamp
"""
human_timestamp = human_timestamp.replace("T", " ")
return human_timestamp_to_datetime(human_timestamp).timestamp()
@@ -390,8 +392,6 @@ def parse_email(data):
headers = json.loads(parsed_email.headers_json).copy()
parsed_email = json.loads(parsed_email.mail_json).copy()
parsed_email["headers"] = headers
if "date" in headers:
parsed_email["date"] = headers["date"].replace("T", " ")
if "received" in parsed_email:
for received in parsed_email["received"]:
if "date_utc" in received:

View File

@@ -6,7 +6,7 @@ xmltodict
geoip2
dnspython
imapclient
mail-parser
mail-parser==3.5.1
dateparser
elasticsearch>=6.3.0,<7.0.0
elasticsearch-dsl>=6.2.1,<7.0.0

View File

@@ -93,8 +93,9 @@ setup(
# requirements files see:
# https://packaging.python.org/en/latest/requirements.html
install_requires=['dnspython', 'publicsuffix', 'xmltodict', 'geoip2',
'urllib3', 'requests', 'imapclient', 'mail-parser',
'dateparser', 'elasticsearch>=6.3.0,<7.0.0',
'urllib3', 'requests', 'imapclient',
'mail-parser==3.5.1', 'dateparser',
'elasticsearch>=6.3.0,<7.0.0',
'elasticsearch-dsl>=6.2.1,<7.0.0', 'kafka-python'
],