Skip to content

Commit 46e2385

Browse files
committed
Add is_base_domain variable to domain for convenience
1 parent eef1210 commit 46e2385

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

trustymail/domain.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,15 @@ def __init__(self, domain_name, timeout, smtp_timeout, smtp_localhost, smtp_port
6565

6666
self.base_domain_name = get_public_suffix(self.domain_name)
6767

68+
self.is_base_domain = True
69+
self.base_domain = None
6870
if self.base_domain_name != self.domain_name:
71+
self.is_base_domain = False
6972
if self.base_domain_name not in Domain.base_domains:
7073
# Populate DMARC for parent.
7174
domain = trustymail.scan(self.base_domain_name, timeout, smtp_timeout, smtp_localhost, smtp_ports, smtp_cache, {'mx': False, 'starttls': False, 'spf': False, 'dmarc': True}, dns_hostnames)
7275
Domain.base_domains[self.base_domain_name] = domain
7376
self.base_domain = Domain.base_domains[self.base_domain_name]
74-
else:
75-
self.base_domain = None
7677

7778
# Start off assuming the host is live unless an error tells us otherwise.
7879
self.is_live = True

0 commit comments

Comments
 (0)