Skip to content

Commit

Permalink
add timeout to verify
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Jun 22, 2020
1 parent 17dbdcf commit 8cac24a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions emailMarketing/emailMarketing.py
Expand Up @@ -164,7 +164,7 @@ def verificationJob(self):
email = items.email
self.currentEmail = email
domainName = email.split('@')[1]
records = DNS.dnslookup(domainName, 'MX')
records = DNS.dnslookup(domainName, 'MX', 15)

counterGlobal = counterGlobal + 1

Expand All @@ -191,9 +191,9 @@ def verificationJob(self):
message='IP being used for validation until next sleep: %s.' % (str(self.currentIP))).save()

if self.currentIP == None:
server = smtplib.SMTP()
server = smtplib.SMTP(timeout=10)
else:
server = smtplib.SMTP(self.currentIP)
server = smtplib.SMTP(self.currentIP, timeout=10)
else:

if self.currentIP == '':
Expand All @@ -203,25 +203,25 @@ def verificationJob(self):
str(self.currentIP))).save()

if self.currentIP == None:
server = smtplib.SMTP()
server = smtplib.SMTP(timeout=10)
else:
server = smtplib.SMTP(self.currentIP)
server = smtplib.SMTP(self.currentIP, timeout=10)
else:
logging.CyberCPLogFileWriter.writeToFile(
'Delay not configured..')

ValidationLog(owner=verificationList, status=backupSchedule.INFO,
message='Delay not configured..').save()

server = smtplib.SMTP()
server = smtplib.SMTP(timeout=10)
except BaseException as msg:

ValidationLog(owner=verificationList, status=backupSchedule.ERROR,
message='Delay not configured. Error message: %s' % (str(msg))).save()

server = smtplib.SMTP()
server = smtplib.SMTP(timeout=10)
else:
server = smtplib.SMTP()
server = smtplib.SMTP(timeout=10)

###

Expand Down

0 comments on commit 8cac24a

Please sign in to comment.