Skip to content

Commit

Permalink
chg: [module mail ectractor] remove DNS check for UI extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Jan 31, 2025
1 parent cc619dc commit f1fe588
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions bin/modules/Mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def check_mx_record(self, set_mxdomains):
print(e)
return valid_mxdomain

def extract(self, obj, content, tag):
def extract(self, obj, content, tag, check_mx_record=False):
extracted = []
mxdomains = {}
mails = self.regex_finditer(self.email_regex, obj.get_global_id(), content)
Expand All @@ -127,9 +127,14 @@ def extract(self, obj, content, tag):
if mxdomain not in mxdomains:
mxdomains[mxdomain] = []
mxdomains[mxdomain].append(mail)
for mx in self.check_mx_record(mxdomains.keys()):
for row in mxdomains[mx]:
extracted.append([row[0], row[1], row[2], f'tag:{tag}'])
if check_mx_record:
for mx in self.check_mx_record(mxdomains.keys()):
for row in mxdomains[mx]:
extracted.append([row[0], row[1], row[2], f'tag:{tag}'])
else:
for mx in mxdomains:
for row in mxdomains[mx]:
extracted.append([row[0], row[1], row[2], f'tag:{tag}'])
return extracted

# # TODO: sanitize mails
Expand Down

0 comments on commit f1fe588

Please sign in to comment.