Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding the possibility to use a third party milter without activating #1

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion jylibs/serverconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

milter is set to None on line 136. No need set that again. Why not just remove lines 139 and 140?


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"])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The template string is incorrect here (line 147). The template string is set to accept two strings ("%s, %s"), but only one is provided.

This also seems a bit redundant, since the value is already set and this logic would just simply reset the self["zimbraMtaSmtpdMilters"] value with the value it already has. What would the purpose of the logic on line 146/147 be?


if self["zimbraMtaHeaderChecks"] is not None:
v = self["zimbraMtaHeaderChecks"]
Expand Down