mirror of
				https://github.com/mail-in-a-box/mailinabox.git
				synced 2025-10-30 18:50:53 +00:00 
			
		
		
		
	Warn when connection to Spamhaus times out
This commit is contained in:
		
							parent
							
								
									0d72566c99
								
							
						
					
					
						commit
						254b235a2f
					
				| @ -293,6 +293,8 @@ def run_network_checks(env, output): | |||||||
| 	zen = query_dns(rev_ip4+'.zen.spamhaus.org', 'A', nxdomain=None) | 	zen = query_dns(rev_ip4+'.zen.spamhaus.org', 'A', nxdomain=None) | ||||||
| 	if zen is None: | 	if zen is None: | ||||||
| 		output.print_ok("IP address is not blacklisted by zen.spamhaus.org.") | 		output.print_ok("IP address is not blacklisted by zen.spamhaus.org.") | ||||||
|  | 	elif zen == "[timeout]": | ||||||
|  | 		output.print_warning("Connection to zen.spamhaus.org timed out. We could not determine whether your server's IP address {} is blacklisted. Please try again later.".format(rev_ip4)) | ||||||
| 	else: | 	else: | ||||||
| 		output.print_error("""The IP address of this machine %s is listed in the Spamhaus Block List (code %s), | 		output.print_error("""The IP address of this machine %s is listed in the Spamhaus Block List (code %s), | ||||||
| 			which may prevent recipients from receiving your email. See http://www.spamhaus.org/query/ip/%s.""" | 			which may prevent recipients from receiving your email. See http://www.spamhaus.org/query/ip/%s.""" | ||||||
| @ -675,9 +677,12 @@ def check_mail_domain(domain, env, output): | |||||||
| 	# Stop if the domain is listed in the Spamhaus Domain Block List. | 	# Stop if the domain is listed in the Spamhaus Domain Block List. | ||||||
| 	# The user might have chosen a domain that was previously in use by a spammer | 	# The user might have chosen a domain that was previously in use by a spammer | ||||||
| 	# and will not be able to reliably send mail. | 	# and will not be able to reliably send mail. | ||||||
| 	dbl = query_dns(domain+'.dbl.spamhaus.org', "A", nxdomain=None) | 	dbl = query_dns(domain+".dbl.spamhaus.org", "A", nxdomain=None) | ||||||
|  | 
 | ||||||
| 	if dbl is None: | 	if dbl is None: | ||||||
| 		output.print_ok("Domain is not blacklisted by dbl.spamhaus.org.") | 		output.print_ok("Domain is not blacklisted by dbl.spamhaus.org.") | ||||||
|  | 	elif dbl == "[timeout]": | ||||||
|  | 		output.print_warning("Connection to dbl.spamhaus.org timed out. We could not determine whether the domain {} is blacklisted. Please try again later.".format(domain)) | ||||||
| 	else: | 	else: | ||||||
| 		output.print_error("""This domain is listed in the Spamhaus Domain Block List (code %s), | 		output.print_error("""This domain is listed in the Spamhaus Domain Block List (code %s), | ||||||
| 			which may prevent recipients from receiving your mail. | 			which may prevent recipients from receiving your mail. | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user