Code cleanup

This commit is contained in:
Sean Whalen
2024-02-19 19:05:12 -05:00
parent efe74091f3
commit a1f141d84c
2 changed files with 6 additions and 5 deletions
+4 -3
View File
@@ -1016,7 +1016,8 @@ def parse_report_email(input_, offline=False, ip_db_path=None,
smtp_tls_report = None
sample = None
if "From" in msg_headers:
logger.info("Parsing mail from {0} on {1}".format(msg_headers["From"], date))
logger.info("Parsing mail from {0} on {1}".format(msg_headers["From"],
date))
if "Subject" in msg_headers:
subject = msg_headers["Subject"]
for part in msg.walk():
@@ -1065,8 +1066,8 @@ def parse_report_email(input_, offline=False, ip_db_path=None,
fields[field_name] = match[1].strip()
feedback_report = "Arrival-Date: {}\n" \
"Source-IP: {}" \
"".format(fields["received-date"],
"Source-IP: {}" \
"".format(fields["received-date"],
fields["sender-ip-address"])
except Exception as e:
error = 'Unable to parse message with ' \
+2 -2
View File
@@ -594,10 +594,10 @@ def _main():
logger.critical("password setting missing from the "
"msgraph config section")
exit(-1)
if opts.graph_auth_method == AuthMethod.DeviceCode.name:
if "user" in graph_config:
opts.graph_user = graph_config["user"]
opts.graph_user = graph_config["user"]
if opts.graph_auth_method != AuthMethod.UsernamePassword.name:
if "tenant_id" in graph_config: