Monorepo for Tangled tangled.org

appview: expand domain of acceptable email addresses #1217

merged opened by tjh.dev targeting master from tjh.dev/core: push-oxmnukovusmv
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:65gha4t3avpfpzmvpbwovss7/sh.tangled.repo.pull/3mhqk2ydqc622
+12 -4
Diff #0
+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
sign up or login to add to the discussion
1 commit
expand
appview: expand domain of acceptable email addresses
expand 3 comments

I can confirm I have no fixed my dev setup and have manually tested this.

s/no/now

Nice, LGTM!

pull request successfully merged
1 commit
expand
appview: expand domain of acceptable email addresses
expand 0 comments
tjh.dev submitted #0
1 commit
expand
appview: expand domain of acceptable email addresses
expand 1 comment

I haven't tested this because my dev setup is broken.