Remove incorrect IMAP changes

This commit is contained in:
Sean Whalen
2026-03-21 14:57:14 -04:00
parent 860cfdd148
commit 5607cd9411
4 changed files with 13 additions and 7 deletions
-1
View File
@@ -21,7 +21,6 @@
- `get_index_prefix()` crashed on forensic reports with `TypeError` due to `report()` instead of `report[]` dict access.
- Missing `exit(1)` after IMAP user/password validation failure allowed execution to continue with `None` credentials.
- IMAP `watch()` leaked a connection on every IDLE cycle by not closing the old `IMAPClient` before replacing it.
## 9.2.1
+12
View File
@@ -814,6 +814,12 @@ class _ElasticsearchHandle:
"""Sentinel so Elasticsearch participates in _close_output_clients."""
def close(self):
try:
conn = elastic.connections.get_connection()
if not isinstance(conn, str):
conn.close()
except Exception:
pass
try:
elastic.connections.remove_connection("default")
except Exception:
@@ -824,6 +830,12 @@ class _OpenSearchHandle:
"""Sentinel so OpenSearch participates in _close_output_clients."""
def close(self):
try:
conn = opensearch.connections.get_connection()
if not isinstance(conn, str):
conn.close()
except Exception:
pass
try:
opensearch.connections.remove_connection("default")
except Exception:
+1 -1
View File
@@ -37,7 +37,7 @@ class GelfClient(object):
"""
self.host = host
self.port = port
self.logger = logging.getLogger("parsedmarc_syslog")
self.logger = logging.getLogger("parsedmarc_gelf")
self.logger.setLevel(logging.INFO)
self.logger.addFilter(ContextFilter())
self.gelf_mode = {
-5
View File
@@ -90,12 +90,7 @@ class IMAPConnection(MailboxConnection):
# IDLE callback sends IMAPClient object,
# send back the imap connection object instead
def idle_callback_wrapper(client: IMAPClient):
old_client = self._client
self._client = client
try:
old_client.logout()
except Exception:
pass
check_callback(self)
while True: