Skip to content
Snippets Groups Projects
Commit 3f081915 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Ignore brackets in email test.

parent fbbc11cb
No related branches found
No related tags found
No related merge requests found
......@@ -68,7 +68,7 @@ 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().replace('[', '').replace(']', '')
else:
configured_relay = ''
if not configured_relay:
......@@ -89,7 +89,7 @@ def check_relay():
if result != 'pass':
print_red('ip %s is not in ubicast.eu SPF and emails sent from support@ubicast.eu may be treated as spam' % ip)
return 3
conf_relay = conf.get('EMAIL_SMTP_SERVER', '').strip('[]')
conf_relay = conf.get('EMAIL_SMTP_SERVER', '').replace('[', '').replace(']', '')
if conf_relay != configured_relay:
print_red('Configured STMP relay (%s) does not match the expected value (%s).' % (configured_relay, conf_relay))
return 3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment