mirror of
https://github.com/domainaware/parsedmarc.git
synced 2026-05-09 21:45:25 +00:00
Fix error message
This commit is contained in:
@@ -1361,6 +1361,7 @@ def watch_inbox(host, username, password, callback, reports_folder="INBOX",
|
||||
nameservers=ns,
|
||||
dns_timeout=dt)
|
||||
callback(res)
|
||||
break
|
||||
|
||||
except imapclient.exceptions.IMAPClientError as error:
|
||||
error = error.__str__().lstrip("b'").rstrip("'").rstrip(".")
|
||||
|
||||
@@ -196,7 +196,7 @@ def save_aggregate_report_to_elasticsearch(aggregate_report):
|
||||
domain = aggregate_report["policy_published"]["domain"]
|
||||
begin_date = parsedmarc.human_timestamp_to_datetime(metadata["begin_date"])
|
||||
end_date = parsedmarc.human_timestamp_to_datetime(metadata["end_date"])
|
||||
begin_date_human = end_date.strftime("%Y-%m-%d %H:%M:%S")
|
||||
begin_date_human = begin_date.strftime("%Y-%m-%d %H:%M:%S")
|
||||
end_date_human = end_date.strftime("%Y-%m-%d %H:%M:%S")
|
||||
aggregate_report["begin_date"] = begin_date
|
||||
aggregate_report["end_date"] = end_date
|
||||
@@ -214,12 +214,12 @@ def save_aggregate_report_to_elasticsearch(aggregate_report):
|
||||
|
||||
existing = search.execute()
|
||||
if len(existing) > 0:
|
||||
raise AlreadySaved("Aggregate report from {0} about {1} with date "
|
||||
"range of {2} UTC to {3} UTC already exists in "
|
||||
"Elasticsearch".format(org_name,
|
||||
domain,
|
||||
begin_date_human,
|
||||
end_date_human))
|
||||
raise AlreadySaved("An aggregate report from {0} about {1} with a "
|
||||
"date range of {2} UTC to {3} UTC already exists "
|
||||
"in Elasticsearch".format(org_name,
|
||||
domain,
|
||||
begin_date_human,
|
||||
end_date_human))
|
||||
published_policy = PublishedPolicy(
|
||||
adkim=aggregate_report["policy_published"]["adkim"],
|
||||
aspf=aggregate_report["policy_published"]["aspf"],
|
||||
@@ -302,7 +302,7 @@ def save_forensic_report_to_elasticsearch(forensic_report):
|
||||
existing = search.execute()
|
||||
|
||||
if len(existing) > 0:
|
||||
raise AlreadySaved("A matching forensic sample to {0} from {1} "
|
||||
raise AlreadySaved("A forensic sample to {0} from {1} "
|
||||
"with a subject of {2} and arrival date of {3} "
|
||||
"already exists in "
|
||||
"Elasticsearch".format(headers["to"],
|
||||
|
||||
Reference in New Issue
Block a user