diff --git a/tests/test_email.py b/tests/test_email.py index cc8e2eb95db0f6f991da196952b6580024d1920f..79490d6ff51e232bc30a30ead3e321aa4b5bbf41 100755 --- a/tests/test_email.py +++ b/tests/test_email.py @@ -70,18 +70,18 @@ def check_relay(): ip = conf.get('NETWORK_IP') with open('/etc/mailname', 'r') as f: d = f.read().strip() - if d not in ('ubicast.tv', 'ubicast.eu'): - print_yellow('/etc/mailname does not contain ubicast.eu or ubicast.tv, mails will probably not be received on ubicast mailing lists') - return 3 - # check spf - status, output = subprocess.getstatusoutput('host -t TXT ubicast.eu') - 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 + if d not in ('ubicast.tv', 'ubicast.eu'): + print_yellow('/etc/mailname does not contain ubicast.eu or ubicast.tv, mails will probably not be received on ubicast mailing lists') + return 3 + # check spf + status, output = subprocess.getstatusoutput('host -t TXT ubicast.eu') + 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', '').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 + return 3 else: print_green('STMP relay is properly set.') return 0