1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-12-25 07:47:05 +00:00
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

View File

@ -525,9 +525,9 @@ def privacy_status_set():
def smtp_relay_get(): def smtp_relay_get():
config = utils.load_settings(env) config = utils.load_settings(env)
return { return {
"enabled": (config.get("SMTP_RELAY_ENABLED", "true") == "true"), "enabled": config.get("SMTP_RELAY_ENABLED", True),
"host": config.get("SMTP_RELAY_HOST", ""), "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", "") "user": config.get("SMTP_RELAY_USER", "")
} }
@ -539,9 +539,9 @@ def smtp_relay_set():
try: try:
# Write on Postfix config # Write on Postfix config
# Write on daemon env # 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_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") config["SMTP_RELAY_USER"] = newconf.get("user")
utils.write_settings(config, env) utils.write_settings(config, env)
# Restart Postfix # Restart Postfix