From 372d5d9783cf5de58cf79383ad27f996546fe427 Mon Sep 17 00:00:00 2001 From: David Duque Date: Tue, 21 Apr 2020 14:35:51 +0100 Subject: [PATCH] SMTP Relays: Wrap ternary operations correctly --- management/daemon.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/management/daemon.py b/management/daemon.py index 26c0e872..26c71661 100755 --- a/management/daemon.py +++ b/management/daemon.py @@ -549,10 +549,10 @@ def smtp_relay_set(): utils.write_settings(config, env) # Write on Postfix configs edit_conf("/etc/postfix/main.cf", [ - "relayhost=" + 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" + "relayhost=" + (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") ], delimiter_re=r"\s*=\s*", delimiter="=", comment_char="#") if config["SMTP_RELAY_AUTH"]: # Edit the sasl password