This commit is contained in:
David Duque 2020-04-17 10:45:47 +01:00
parent 9b6781685a
commit 6d8e2a5bb9
No known key found for this signature in database
GPG Key ID: 2F327738A3C0AE3A
1 changed files with 4 additions and 4 deletions

View File

@ -525,9 +525,9 @@ def privacy_status_set():
def smtp_relay_get():
config = utils.load_settings(env)
return {
"enabled": (config.get("SMTP_RELAY_ENABLED", "true") == "true"),
"enabled": config.get("SMTP_RELAY_ENABLED", True),
"host": config.get("SMTP_RELAY_HOST", ""),
"auth_enabled": (config.get("SMTP_RELAY_AUTH", "false") == "true"),
"auth_enabled": config.get("SMTP_RELAY_AUTH", False),
"user": config.get("SMTP_RELAY_USER", "")
}
@ -539,9 +539,9 @@ def smtp_relay_set():
try:
# Write on Postfix config
# Write on daemon env
config["SMTP_RELAY_ENABLED"] = "true" if newconf.get("enabled") else "false"
config["SMTP_RELAY_ENABLED"] = newconf.get("enabled")
config["SMTP_RELAY_HOST"] = newconf.get("host")
config["SMTP_RELAY_AUTH"] = "true" if newconf.get("auth_enabled") else "false"
config["SMTP_RELAY_AUTH"] = newconf.get("auth_enabled")
config["SMTP_RELAY_USER"] = newconf.get("user")
utils.write_settings(config, env)
# Restart Postfix