some more fixes

This commit is contained in:
2021-10-04 13:18:53 +02:00
parent 32bebf873d
commit 251f15a1d9
3 changed files with 5 additions and 3 deletions

View File

@@ -197,7 +197,8 @@ class StoreConfig(BaseConfig):
"directory": {"type": "string"},
"mode": {"type": "string"},
"metavar": {"type": "string"},
"original": {"type": "boolean", "default": True}}}}
"metadata": {"type": "boolean", "default": False},
"original": {"type": "boolean", "default": False}}}}
class NotifyConfig(BaseConfig):
@@ -245,6 +246,8 @@ class QuarantineConfig(BaseConfig):
def __init__(self, config, rec=True):
super().__init__(config)
if rec:
if "metadata" not in self["store"]:
self["store"]["metadata"] = True
self["store"] = StoreConfig(self["store"])
if "notify" in self:
self["notify"] = NotifyConfig(self["notify"])

View File

@@ -266,7 +266,7 @@ class EMailNotification(BaseNotification):
variables["ENVELOPE_TO_URL"] = escape(quote(recipient))
for field in ["from", "to", "subject"]:
value = msg[field]
if not value:
if value is None:
continue
variables[field.upper()] = escape(value, quote=False)

View File

@@ -362,7 +362,6 @@ class Quarantine:
"pretend": cfg["pretend"],
"type": "store",
"args": cfg["args"]["store"].get_config()})
storage_cfg["args"]["metadata"] = True
self._storage = Store(storage_cfg, local_addrs, debug)
self.smtp_host = cfg["args"]["smtp_host"]