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

Consider wrong smtp relay as non critical problem.

parent f9dc4a8a
No related branches found
No related tags found
No related merge requests found
...@@ -70,18 +70,18 @@ def check_relay(): ...@@ -70,18 +70,18 @@ def check_relay():
ip = conf.get('NETWORK_IP') ip = conf.get('NETWORK_IP')
with open('/etc/mailname', 'r') as f: with open('/etc/mailname', 'r') as f:
d = f.read().strip() d = f.read().strip()
if d not in ('ubicast.tv', 'ubicast.eu'): 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') print_yellow('/etc/mailname does not contain ubicast.eu or ubicast.tv, mails will probably not be received on ubicast mailing lists')
return 3 return 3
# check spf # check spf
status, output = subprocess.getstatusoutput('host -t TXT ubicast.eu') status, output = subprocess.getstatusoutput('host -t TXT ubicast.eu')
if ip not in output: 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) 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 return 1
conf_relay = conf.get('EMAIL_SMTP_SERVER', '').strip('[]') conf_relay = conf.get('EMAIL_SMTP_SERVER', '').strip('[]')
if conf_relay != configured_relay: if conf_relay != configured_relay:
print_red('Configured STMP relay (%s) does not match the expected value (%s).' % (configured_relay, conf_relay)) print_red('Configured STMP relay (%s) does not match the expected value (%s).' % (configured_relay, conf_relay))
return 1 return 3
else: else:
print_green('STMP relay is properly set.') print_green('STMP relay is properly set.')
return 0 return 0
......
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