Skip to content

Commit

Permalink
fix: [mail module] reduce disk usage, remove faup
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Feb 19, 2025
1 parent 129654e commit aa6677f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions bin/modules/Mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import dns.resolver
import dns.exception

from pyfaup.faup import Faup
# from pyfaup.faup import Faup

sys.path.append(os.environ['AIL_BIN'])
##################################
Expand All @@ -43,7 +43,7 @@ def __init__(self, queue=True):

self.dns_server = config_loader.get_config_str('Mail', 'dns')

self.faup = Faup()
# self.faup = Faup()

# Numbers of Mails needed to Tags
self.mail_threshold = 10
Expand Down Expand Up @@ -153,7 +153,7 @@ def compute(self, message):

valid_mx = self.check_mx_record(mxdomains_email.keys())
print(f'valid_mx: {valid_mx}')
mx_tlds = {}
# mx_tlds = {}
num_valid_email = 0
for domain_mx in valid_mx:
nb_mails = len(mxdomains_email[domain_mx])
Expand All @@ -164,13 +164,13 @@ def compute(self, message):
# self.add_message_to_queue(msg, 'ModuleStats')

# Create country stats
self.faup.decode(domain_mx)
tld = self.faup.get()['tld']
try:
tld = tld.decode()
except:
pass
mx_tlds[tld] = mx_tlds.get(tld, 0) + nb_mails
# self.faup.decode(domain_mx)
# tld = self.faup.get()['tld']
# try:
# tld = tld.decode()
# except:
# pass
# mx_tlds[tld] = mx_tlds.get(tld, 0) + nb_mails
# for tld in mx_tlds:
# Statistics.add_module_tld_stats_by_date('mail', item_date, tld, mx_tlds[tld])

Expand Down

0 comments on commit aa6677f

Please sign in to comment.