mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Expect SOA mailbox in hostmaster@example.org format instead of hostmaster.example.org (#2037)
Co-authored-by: Yannik Sembritzki <yannik@sembritzki.org> Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
committed by
GitHub
parent
9eacd42b63
commit
dc02d5b74f
11
pkg/soautil/soautil.go
Normal file
11
pkg/soautil/soautil.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package soautil
|
||||
|
||||
import "strings"
|
||||
|
||||
func RFC5322MailToBind(rfc5322Mail string) string {
|
||||
res := strings.SplitN(rfc5322Mail, "@", 2)
|
||||
user_part, domain_part := res[0], res[1]
|
||||
// RFC-1035 [Section-8]
|
||||
user_part = strings.ReplaceAll(user_part, ".", "\\.")
|
||||
return user_part + "." + domain_part
|
||||
}
|
Reference in New Issue
Block a user