From ea777d9d184f2e02e9b947373adead6f4439b04c Mon Sep 17 00:00:00 2001 From: Bjoern Date: Sat, 24 Dec 2022 00:19:21 +0100 Subject: [PATCH] Fix Bug with wrong ip_db_path (#338 #287) (#369) Fixes the problem when only a file path was specified instead of a file Reportet with Issues: Not a valid aggregate or forensic report after fresh Install with 8.3.x #338 Not a valid aggregate or forensic report after Update to 7.1.1 #287 --- parsedmarc/utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/parsedmarc/utils.py b/parsedmarc/utils.py index cfa6283..ce8be91 100644 --- a/parsedmarc/utils.py +++ b/parsedmarc/utils.py @@ -292,6 +292,11 @@ def get_ip_address_country(ip_address, db_path=None): "dbip-country.mmdb", ] + if db_path is not None: + if os.path.isfile(db_path) is False: + db_path = None + logger.warning("IP database Option contains no file. Use internal file") + if db_path is None: for system_path in db_paths: if os.path.exists(system_path):