Fixing editconf input

This commit is contained in:
David Duque 2020-04-18 00:00:35 +01:00
parent 625eca8ea4
commit 10e4b79423
No known key found for this signature in database
GPG Key ID: 2F327738A3C0AE3A
1 changed files with 4 additions and 4 deletions

View File

@ -546,10 +546,10 @@ def smtp_relay_set():
utils.write_settings(config, env)
# Write on Postfix config
edit_conf("/etc/postfix/main.cf", [
["relay_host", f"[{config['SMTP_RELAY_HOST']}]:587" if config["SMTP_RELAY_ENABLED"] else ""],
["smtp_sasl_auth_enable", "yes" if config["SMTP_RELAY_AUTH"] else "no"],
["smtp_sasl_security_options", "noanonymous" if config["SMTP_RELAY_AUTH"] else "anonymous"],
["smtp_sasl_tls_security_options", "noanonymous" if config["SMTP_RELAY_AUTH"] else "anonymous"],
"relay_host=" + f"[{config['SMTP_RELAY_HOST']}]:587" if config["SMTP_RELAY_ENABLED"] else "",
"smtp_sasl_auth_enable=" + "yes" if config["SMTP_RELAY_AUTH"] else "no",
"smtp_sasl_security_options=" + "noanonymous" if config["SMTP_RELAY_AUTH"] else "anonymous",
"smtp_sasl_tls_security_options=" + "noanonymous" if config["SMTP_RELAY_AUTH"] else "anonymous"
], False, False)
if config["SMTP_RELAY_AUTH"]:
# Edit the sasl password