fix logging and notifications

This commit is contained in:
2024-01-10 15:50:35 +01:00
parent 2218107228
commit 3ca6dd468f
5 changed files with 12 additions and 4 deletions

View File

@@ -406,6 +406,8 @@ class Quarantine:
self.logger = logging.getLogger(cfg["name"])
self.logger.setLevel(cfg.get_loglevel(debug))
name = cfg["options"]["store"]["name"]
cfg["options"]["store"]["name"] = f"{cfg['name']}: {name}"
cfg["options"]["store"]["loglevel"] = cfg["loglevel"]
self._storage = Store(cfg["options"]["store"], local_addrs, debug)
@@ -414,6 +416,8 @@ class Quarantine:
self._notification = None
if "notify" in cfg["options"]:
name = cfg["options"]["notify"]["name"]
cfg["options"]["notify"]["name"] = f"{cfg['name']}: {name}"
cfg["options"]["notify"]["loglevel"] = cfg["loglevel"]
self._notification = Notify(
cfg["options"]["notify"], local_addrs, debug)
@@ -559,6 +563,8 @@ class Quarantine:
if self._milter_action in ["REJECT", "DISCARD"]:
logger.info(f"quarantine message for {rcpts}")
else:
logger.info(f"save message for {rcpts}")
self._storage.execute(milter)