Compare commits

..

4 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
3509e5c553 Fix resource leak: validate HEC settings before creating any output clients
Co-authored-by: seanthegeek <44679+seanthegeek@users.noreply.github.com>
Agent-Logs-Url: https://github.com/domainaware/parsedmarc/sessions/38c73e09-789d-4d41-b75e-bbc61418859d
2026-03-20 22:52:49 +00:00
copilot-swe-agent[bot]
964a1baeed Initial plan 2026-03-20 22:49:31 +00:00
Sean Whalen
7688d00226 Update parsedmarc/cli.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-20 18:49:09 -04:00
Copilot
8796c7e3bd Fix SIGHUP reload tight-loop in watch mode (#702)
* Initial plan

* Fix _reload_requested tight-loop: reset flag before reload to capture concurrent SIGHUPs

Co-authored-by: seanthegeek <44679+seanthegeek@users.noreply.github.com>
Agent-Logs-Url: https://github.com/domainaware/parsedmarc/sessions/879d0bb1-9037-41f7-bc89-f59611956d2e

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: seanthegeek <44679+seanthegeek@users.noreply.github.com>
2026-03-20 17:31:45 -04:00

View File

@@ -832,6 +832,13 @@ def _init_output_clients(opts):
Raises:
ConfigurationError: If a required output client cannot be created.
"""
# Validate all required settings before creating any clients so that a
# ConfigurationError does not leave partially-created clients un-closed.
if opts.hec and (opts.hec_token is None or opts.hec_index is None):
raise ConfigurationError(
"HEC token and HEC index are required when using HEC URL"
)
clients = {}
if opts.save_aggregate or opts.save_forensic or opts.save_smtp_tls:
@@ -940,10 +947,6 @@ def _init_output_clients(opts):
)
if opts.hec:
if opts.hec_token is None or opts.hec_index is None:
raise ConfigurationError(
"HEC token and HEC index are required when using HEC URL"
)
verify = True
if opts.hec_skip_certificate_verification:
verify = False
@@ -1995,6 +1998,12 @@ def _main():
logger.info("Watching for email - Quit with ctrl-c")
while True:
# Re-check mailbox_watch in case a config reload disabled watch mode
if not opts.mailbox_watch:
logger.info(
"Mailbox watch disabled in reloaded configuration, stopping watcher"
)
break
try:
watch_inbox(
mailbox_connection=mailbox_connection,