From f4470a7dd224adf7181bfc45a5f90edef92e636d Mon Sep 17 00:00:00 2001 From: Sean Whalen Date: Sun, 30 Nov 2025 13:46:21 -0500 Subject: [PATCH] Fix normalize_timespan_threshold_hours --- parsedmarc/cli.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/parsedmarc/cli.py b/parsedmarc/cli.py index 208fde2..004aea8 100644 --- a/parsedmarc/cli.py +++ b/parsedmarc/cli.py @@ -77,6 +77,7 @@ def cli_parse( always_use_local_files, reverse_dns_map_path, reverse_dns_map_url, + normalize_timespan_threshold_hours, conn, ): """Separated this function for multiprocessing""" @@ -91,6 +92,7 @@ def cli_parse( nameservers=nameservers, dns_timeout=dns_timeout, strip_attachment_payloads=sa, + normalize_timespan_threshold_hours=normalize_timespan_threshold_hours, ) conn.send([file_results, file_path]) except ParserError as error: @@ -659,6 +661,7 @@ def _main(): webhook_forensic_url=None, webhook_smtp_tls_url=None, webhook_timeout=60, + normalize_timespan_threshold_hours=24.0, ) args = arg_parser.parse_args() @@ -674,11 +677,9 @@ def _main(): if "general" in config.sections(): general_config = config["general"] if "silent" in general_config: - if not general_config.getboolean("silent"): - opts.silent = False - normalize_timespan_threshold_hours = 24.0 + opts.silent = general_config.getboolean("silent") if "normalize_timespan_threshold_hours" in general_config: - normalize_timespan_threshold_hours = general_config.getfloat( + opts.normalize_timespan_threshold_hours = general_config.getfloat( "normalize_timespan_threshold_hours" ) if "index_prefix_domain_map" in general_config: @@ -1450,6 +1451,7 @@ def _main(): opts.always_use_local_files, opts.reverse_dns_map_path, opts.reverse_dns_map_url, + opts.normalize_timespan_threshold_hours, child_conn, ), ) @@ -1500,7 +1502,7 @@ def _main(): reverse_dns_map_path=opts.reverse_dns_map_path, reverse_dns_map_url=opts.reverse_dns_map_url, offline=opts.offline, - normalize_timespan_threshold_hours=normalize_timespan_threshold_hours, + normalize_timespan_threshold_hours=opts.normalize_timespan_threshold_hours, ) aggregate_reports += reports["aggregate_reports"] forensic_reports += reports["forensic_reports"] @@ -1610,7 +1612,7 @@ def _main(): test=opts.mailbox_test, strip_attachment_payloads=opts.strip_attachment_payloads, since=opts.mailbox_since, - normalize_timespan_threshold_hours=normalize_timespan_threshold_hours, + normalize_timespan_threshold_hours=opts.normalize_timespan_threshold_hours, ) aggregate_reports += reports["aggregate_reports"] @@ -1673,6 +1675,7 @@ def _main(): reverse_dns_map_path=opts.reverse_dns_map_path, reverse_dns_map_url=opts.reverse_dns_map_url, offline=opts.offline, + normalize_timespan_threshold_hours=opts.normalize_timespan_threshold_hours, ) except FileExistsError as error: logger.error("{0}".format(error.__str__()))