print("The response from %s (%s) is not correct:"%(description,server))
print("The response from %s (%s) is not correct:"%(description,server))
print()
print()
has_diff=True
has_diff=True
sys.stdout.write(line)
sys.stdout.write(line)
returnnothas_diff
returnnothas_diff
# Test the response from the machine itself.
# Test the response from the machine itself.
iftest(ipaddr,"Mail-in-a-Box"):
ifnottest(ipaddr,"Mail-in-a-Box"):
print()
print("Please run the Mail-in-a-Box setup script on %s again."%hostname)
sys.exit(1)
else:
# If those settings are OK, also test Google's Public DNS
# If those settings are OK, also test Google's Public DNS
# to see if the machine is hooked up to recursive DNS properly.
# to see if the machine is hooked up to recursive DNS properly.
iftest("8.8.8.8","Google Public DNS"):
ifnottest("8.8.8.8","Google Public DNS"):
print("DNS is OK.")
sys.exit(0)
else:
print()
print()
print("Check that the nameserver settings for %s are correct at your domain registrar."%hostname)
print("Check that the nameserver settings for %s are correct at your domain registrar. It may take a few hours for Google Public DNS to update after changes on your Mail-in-a-Box."%hostname)
sys.exit(1)
sys.exit(1)
else:
# And if that's OK, also check reverse DNS (the PTR record).
ifnottest_ptr("8.8.8.8","Google Public DNS (Reverse DNS)"):
print()
print("The reverse DNS for %s is not correct. Consult your ISP for how to set the reverse DNS (also called the PTR record) for %s to %s."%(hostname,hostname,ipaddr))