1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00
Yannik Sembritzki dc02d5b74f 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>
2023-02-07 09:25:41 -05:00

12 lines
293 B
Go

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
}