From 46ac46296f2781e10a60c250e439eecced3fd338 Mon Sep 17 00:00:00 2001 From: Frdric Maussion Date: Thu, 23 Mar 2017 13:13:29 -0400 Subject: [PATCH 1/2] Adding the possibility to use a third party milter without activating the zimbra one. --- jylibs/serverconfig.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jylibs/serverconfig.py b/jylibs/serverconfig.py index 1a2054f..a4b193a 100644 --- a/jylibs/serverconfig.py +++ b/jylibs/serverconfig.py @@ -137,12 +137,14 @@ def load(self, hostname): if (self["zimbraMilterServerEnabled"] == "TRUE"): milter = "inet:%s:%s" % (self["zimbraMilterBindAddress"],self["zimbraMilterBindPort"]) else: - self["zimbraMtaSmtpdMilters"] = "" + milter = None if self["zimbraMtaSmtpdMilters"] is not None and milter is not None: self["zimbraMtaSmtpdMilters"] = "%s, %s" % (self["zimbraMtaSmtpdMilters"], milter) elif self["zimbraMtaSmtpdMilters"] is None and milter is not None: self["zimbraMtaSmtpdMilters"] = milter + elif self["zimbraMtaSmtpdMilters"] is not None and milter is None: + self["zimbraMtaSmtpdMilters"] = "%s, %s" % (self["zimbraMtaSmtpdMilters"]) if self["zimbraMtaHeaderChecks"] is not None: v = self["zimbraMtaHeaderChecks"] From d42d42ab02b7e2bf12b121405f2026a928c9b4ff Mon Sep 17 00:00:00 2001 From: Frederic Maussion Date: Fri, 5 Jan 2018 01:02:31 +0100 Subject: [PATCH 2/2] 2. Adding a third scenario when zimbraMtaSmtpdMilters and zimbraMilterServerEnabled is set to FALSE --- jylibs/serverconfig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jylibs/serverconfig.py b/jylibs/serverconfig.py index a4b193a..332d8d7 100644 --- a/jylibs/serverconfig.py +++ b/jylibs/serverconfig.py @@ -143,8 +143,8 @@ def load(self, hostname): self["zimbraMtaSmtpdMilters"] = "%s, %s" % (self["zimbraMtaSmtpdMilters"], milter) elif self["zimbraMtaSmtpdMilters"] is None and milter is not None: self["zimbraMtaSmtpdMilters"] = milter - elif self["zimbraMtaSmtpdMilters"] is not None and milter is None: - self["zimbraMtaSmtpdMilters"] = "%s, %s" % (self["zimbraMtaSmtpdMilters"]) + else: + self["zimbraMtaSmtpdMilters"] if self["zimbraMtaHeaderChecks"] is not None: v = self["zimbraMtaHeaderChecks"]