20
20
REVIEW_SHOW_IMPROVEMENTS_ONLY = get_config_or_default ('review_show_improvements_only' )
21
21
REQUEST_TIMEOUT = get_config_or_default ('http_request_timeout' )
22
22
USERAGENT = get_config_or_default ('useragent' )
23
+ EMAIL_NETWORK_SUPPORT_PORT25_TRAFFIC = get_config_or_default ('EMAIL_NETWORK_SUPPORT_PORT25_TRAFFIC' )
24
+ EMAIL_NETWORK_SUPPORT_IPV6_TRAFFIC = get_config_or_default ('EMAIL_NETWORK_SUPPORT_IPV6_TRAFFIC' )
23
25
24
26
checked_urls = {}
25
27
26
28
# We are doing this to support IPv6
27
- class SmtpWebperf (smtplib .SMTP ):
28
- def __init__ (self , host = '' , port = 0 , local_hostname = None ,
29
+ class SmtpWebperf (smtplib .SMTP ): # pylint: disable=too-many-instance-attributes
30
+ def __init__ (self , host = '' , port = 0 , local_hostname = None , # pylint: disable=too-many-arguments
29
31
timeout = socket ._GLOBAL_DEFAULT_TIMEOUT ,
30
32
source_address = None ):
31
33
"""Initialize a new instance.
@@ -357,13 +359,6 @@ def validate_email_domain(hostname, result_dict, global_translation, local_trans
357
359
if hostname .startswith ('www.' ):
358
360
hostname = hostname [4 :]
359
361
360
- # 0.0 - Preflight (Will probably resolve 98% of questions from people trying this test themself)
361
- # 0.1 - Check for allowed connection over port 25 (most consumer ISP don't allow this)
362
- support_port25 = False
363
- # 0.2 - Check for allowed IPv6 support
364
- # (GitHub Actions doesn't support it on network lever on the time of writing this)
365
- support_ipv6 = False
366
-
367
362
# 1 - Get Email servers
368
363
# dns_lookup
369
364
rating , ipv4_servers , ipv6_servers = validate_mx_records (
@@ -372,12 +367,14 @@ def validate_email_domain(hostname, result_dict, global_translation, local_trans
372
367
# If we have -1.0 in rating, we have no MX records, ignore test.
373
368
if rating .get_overall () != - 1.0 :
374
369
# 1.2 - Check operational
375
- if support_port25 and len (ipv4_servers ) > 0 :
370
+ if EMAIL_NETWORK_SUPPORT_PORT25_TRAFFIC and len (ipv4_servers ) > 0 :
376
371
rating = validate_ip4_operation_status (
377
372
global_translation , rating , local_translation , ipv4_servers )
378
373
379
374
# 1.2 - Check operational
380
- if support_port25 and support_ipv6 and len (ipv6_servers ) > 0 :
375
+ if EMAIL_NETWORK_SUPPORT_PORT25_TRAFFIC and \
376
+ EMAIL_NETWORK_SUPPORT_IPV6_TRAFFIC and \
377
+ len (ipv6_servers ) > 0 :
381
378
rating = validate_ip6_operation_status (
382
379
global_translation , rating , local_translation , ipv6_servers )
383
380
0 commit comments