improve config check

This commit is contained in:
2021-10-01 00:24:02 +02:00
parent 6a242e7d02
commit b9b6a62b5e
2 changed files with 7 additions and 8 deletions

View File

@@ -101,17 +101,12 @@ def main():
if not rule["actions"]:
raise RuntimeError(
f"{rule['name']}: no actions configured")
ModifyMilter.set_config(cfg, args.debug)
except (RuntimeError, AssertionError) as e:
logger.error(f"config error: {e}")
sys.exit(255)
try:
ModifyMilter.set_config(cfg, args.debug)
except RuntimeError as e:
logger.error(e)
sys.exit(254)
if args.test:
print("Configuration OK")
sys.exit(0)