Skip to content

Commit

Permalink
update firewall to secureGateway
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbr0wn authored and alexopenline committed Aug 30, 2024
1 parent 7f2f3ad commit 02ca0a1
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion bulkvalidate/bulkvalidate.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func writeResultsFile(results []run.VerifyEmailResponse, filePath string, append
resp.Email, resp.Syntax.User, resp.Syntax.Domain,
strconv.FormatBool(resp.Syntax.IsValid),
resp.IsDeliverable,
resp.Provider, resp.Firewall,
resp.Provider, resp.SecureGatewayProvider,
strconv.FormatBool(resp.IsRisky),
strconv.FormatBool(resp.Risk.IsFirewalled),
strconv.FormatBool(resp.Risk.IsFreeAccount),
Expand Down
48 changes: 24 additions & 24 deletions internal/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ import (
)

type VerifyEmailResponse struct {
Email string
IsDeliverable string
IsValidSyntax bool
IsCatchAll bool
Provider string
Firewall string
IsRisky bool
Risk VerifyEmailRisk
Syntax mailvalidate.SyntaxValidation
RetryValidation bool
Smtp mailvalidate.SmtpResponse
MailServerHealth mailvalidate.MailServerHealth
Email string
IsDeliverable string
IsValidSyntax bool
IsCatchAll bool
Provider string
SecureGatewayProvider string
IsRisky bool
Risk VerifyEmailRisk
Syntax mailvalidate.SyntaxValidation
RetryValidation bool
Smtp mailvalidate.SmtpResponse
MailServerHealth mailvalidate.MailServerHealth
}

type VerifyEmailRisk struct {
Expand Down Expand Up @@ -81,18 +81,18 @@ func BuildResponse(
}

response := VerifyEmailResponse{
Email: cleanEmail,
IsDeliverable: email.IsDeliverable,
IsValidSyntax: syntax.IsValid,
IsCatchAll: domain.IsCatchAll,
Provider: domain.Provider,
Firewall: domain.Firewall,
IsRisky: isRisky,
Risk: risk,
RetryValidation: email.RetryValidation,
Syntax: syntax,
Smtp: email.SmtpResponse,
MailServerHealth: email.MailServerHealth,
Email: cleanEmail,
IsDeliverable: email.IsDeliverable,
IsValidSyntax: syntax.IsValid,
IsCatchAll: domain.IsCatchAll,
Provider: domain.Provider,
SecureGatewayProvider: domain.SecureGatewayProvider,
IsRisky: isRisky,
Risk: risk,
RetryValidation: email.RetryValidation,
Syntax: syntax,
Smtp: email.SmtpResponse,
MailServerHealth: email.MailServerHealth,
}

return response
Expand Down
24 changes: 12 additions & 12 deletions mailvalidate/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ type SyntaxValidation struct {
}

type DomainValidation struct {
Provider string
Firewall string
AuthorizedSenders dns.AuthorizedSenders
IsFirewalled bool
IsCatchAll bool
HasMXRecord bool
HasSPFRecord bool
SmtpResponse SmtpResponse
MailServerHealth MailServerHealth
Error string
Provider string
SecureGatewayProvider string
AuthorizedSenders dns.AuthorizedSenders
IsFirewalled bool
IsCatchAll bool
HasMXRecord bool
HasSPFRecord bool
SmtpResponse SmtpResponse
MailServerHealth MailServerHealth
Error string
}

type EmailValidation struct {
Expand Down Expand Up @@ -196,7 +196,7 @@ func evaluateDnsRecords(validationRequest *EmailValidationRequest, knownProvider
provider, firewall := dns.GetEmailProviderFromMx(*validationRequest.Dns, *knownProviders)
results.Provider = provider
if firewall != "" {
results.Firewall = firewall
results.SecureGatewayProvider = firewall
results.IsFirewalled = true
}
}
Expand All @@ -219,7 +219,7 @@ func evaluateDnsRecords(validationRequest *EmailValidationRequest, knownProvider

if !results.IsFirewalled && len(results.AuthorizedSenders.Security) > 0 {
results.IsFirewalled = true
results.Firewall = results.AuthorizedSenders.Security[0]
results.SecureGatewayProvider = results.AuthorizedSenders.Security[0]
}
}

Expand Down

0 comments on commit 02ca0a1

Please sign in to comment.