Skip to content

Commit

Permalink
move retry logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbr0wn authored and alexopenline committed Dec 7, 2024
1 parent 6ba758e commit 1f5677c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions mailvalidate/email_address.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,8 @@ func handleAlternateEmail(req *EmailValidationRequest, results *EmailValidation)

// handleSmtpResponses processes SMTP response codes and descriptions
func handleSmtpResponses(req *EmailValidationRequest, resp *EmailValidation) {
resp.RetryValidation = true

if isNoMXRecordError(resp.SmtpResponse.Description) {
resp.IsDeliverable = "false"
resp.RetryValidation = false
return
}

Expand Down Expand Up @@ -204,6 +201,7 @@ func handleTemporaryFailure(req *EmailValidationRequest, resp *EmailValidation)
case isBlacklistError(resp.SmtpResponse.Description):
blacklisted(req, resp)
case isGreylistError(resp.SmtpResponse.Description):
resp.RetryValidation = true
greylisted(req, resp)
case isMailboxFullError(resp.SmtpResponse.Description):
handleMailboxFull(resp)
Expand Down

0 comments on commit 1f5677c

Please sign in to comment.