-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.go
35 lines (31 loc) · 1.06 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package validator
import "regexp"
// Config of the validator
type Config struct {
Email Email // Email config
Domain Domain // Domain config
Log func(msg string, args ...any) // Log func
}
// Email checks configuration
type Email struct {
// Enforce enforces email check and rejects empty emails
Enforce bool
// SMTP enforces SMTP check (email actually exists on mail server) and rejects non-existing emails
SMTP bool
// SPF enforces SPF record check (sender allowed to use that email and send emails) and rejects unathorized emails
SPF bool
// MX enforces MX records check on email's mail server
MX bool
// From is a valid email address that will be used for SMTP checks
From string
// Spamlist is a list of spam emails with wildcards
Spamlist []string
spamlist []*regexp.Regexp
}
// Domain checks configuration
type Domain struct {
// Enforce enforces domain check and rejects empty domains
Enforce bool
// PrivateSuffixes considers subdomains with the following suffixes as domains
PrivateSuffixes []string
}