From f849ac576e12c116d64b9a0e4d7676c7ed327d74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu> Date: Fri, 30 Jun 2017 09:05:48 +0200 Subject: [PATCH] Ignore brackets in SMTP relay. --- tests/test_email.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_email.py b/tests/test_email.py index 66f32f9b..0d6fd304 100755 --- a/tests/test_email.py +++ b/tests/test_email.py @@ -56,9 +56,9 @@ def check_relay(): print('Checking if SMTP relay conforms to conf.') status, out = subprocess.getstatusoutput('grep relayhost /etc/postfix/main.cf') if status == 0: - configured_relay = out[len('relayhost'):].strip(' \t=') + configured_relay = out[len('relayhost'):].strip(' \t=[]') else: - configured_relay = None + configured_relay = '' if not configured_relay: # no relay configured, check relayless situations ip = conf.get('NETWORK_IP_NAT') @@ -74,7 +74,7 @@ def check_relay(): if ip not in output: print_red('ip %s is not in ubicast.eu SPF and emails sent from support@ubicast.eu will be treated as spam' % ip) return 1 - conf_relay = conf.get('EMAIL_SMTP_SERVER') + conf_relay = conf.get('EMAIL_SMTP_SERVER', '').strip('[]') if conf_relay != configured_relay: print_red('Configured STMP relay (%s) does not match the expected value (%s).' % (configured_relay, conf_relay)) return 1 -- GitLab