diff --git a/tests/test_email.py b/tests/test_email.py index 50a304329332b854208428afdcd837d0f44dcf7a..811f07bb06f423c9c0b2e2fa22edcd69d06ab807 100755 --- a/tests/test_email.py +++ b/tests/test_email.py @@ -53,8 +53,15 @@ def check_relay(): if status == 0: configured_relay = out[len('relayhost'):].strip(' \t=') else: - print_red('Configured relay not found.') - return False + configured_relay = None + if not configured_relay: + # no relay configured, check relayless situations + domain = conf.get('MS_SERVER_NAME').split('.')[-2:] + with open('/etc/mailname', 'r') as f: + d = f.read() + if domain != 'ubicast.tv' and domain not in d: + print_red('/etc/mailname does not contain the server domain, emails will probably be treated as spam') + return False conf_relay = conf.get('EMAIL_SMTP_SERVER') if conf_relay != configured_relay: print_red('Configured STMP relay (%s) does not match the expected value (%s).' % (configured_relay, conf_relay))