Signed-off-by: tjh x@tjh.dev
+12
-4
Diff
round #0
+12
-4
appview/email/email.go
+12
-4
appview/email/email.go
···
49
49
parts := strings.Split(addr.Address, "@")
50
50
domain := parts[1]
51
51
52
-
mx, err := net.LookupMX(domain)
53
-
if err != nil || len(mx) == 0 {
54
-
return false
52
+
// Ignore err because mx may contain valid records if err != nil anyway.
53
+
mx, _ := net.LookupMX(domain)
54
+
55
+
if len(mx) != 0 {
56
+
return true
57
+
} else {
58
+
// Ignore err because addr will be nil if any errors occur anyway.
59
+
addr, _ := net.LookupIP(domain)
60
+
if len(addr) != 0 {
61
+
return true
62
+
}
55
63
}
56
64
57
-
return true
65
+
return false
58
66
}
History
3 rounds
4 comments
1 commit
expand
collapse
appview: expand domain of acceptable email addresses
Use address resolution steps from RFC5321 section 5.1 when validating
email addresses.
ref: https://datatracker.ietf.org/doc/html/rfc5321#section-5.1
Signed-off-by: tjh <x@tjh.dev>
1 commit
expand
collapse
appview: expand domain of acceptable email addresses
Use address resolution steps from RFC5321 section 5.1 when validating
email addresses.
ref: https://datatracker.ietf.org/doc/html/rfc5321#section-5.1
Signed-off-by: tjh <x@tjh.dev>
I can confirm I have no fixed my dev setup and have manually tested this.