Skip to content

Commit aa6677f

Browse files
committed
fix: [mail module] reduce disk usage, remove faup
1 parent 129654e commit aa6677f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

bin/modules/Mail.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import dns.resolver
2020
import dns.exception
2121

22-
from pyfaup.faup import Faup
22+
# from pyfaup.faup import Faup
2323

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

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

46-
self.faup = Faup()
46+
# self.faup = Faup()
4747

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

154154
valid_mx = self.check_mx_record(mxdomains_email.keys())
155155
print(f'valid_mx: {valid_mx}')
156-
mx_tlds = {}
156+
# mx_tlds = {}
157157
num_valid_email = 0
158158
for domain_mx in valid_mx:
159159
nb_mails = len(mxdomains_email[domain_mx])
@@ -164,13 +164,13 @@ def compute(self, message):
164164
# self.add_message_to_queue(msg, 'ModuleStats')
165165

166166
# Create country stats
167-
self.faup.decode(domain_mx)
168-
tld = self.faup.get()['tld']
169-
try:
170-
tld = tld.decode()
171-
except:
172-
pass
173-
mx_tlds[tld] = mx_tlds.get(tld, 0) + nb_mails
167+
# self.faup.decode(domain_mx)
168+
# tld = self.faup.get()['tld']
169+
# try:
170+
# tld = tld.decode()
171+
# except:
172+
# pass
173+
# mx_tlds[tld] = mx_tlds.get(tld, 0) + nb_mails
174174
# for tld in mx_tlds:
175175
# Statistics.add_module_tld_stats_by_date('mail', item_date, tld, mx_tlds[tld])
176176

0 commit comments

Comments
 (0)