func (v *Value) qualify(name, suffix, apexSuffix string) (string, bool) { s := v.qualifyIntl(name, suffix, apexSuffix) if !util.ValidateHostName(s) { return "", false } return s, true }
func convertEmail(email string) (string, error) { if email == "" { return ".", nil } if util.ValidateHostName(email) { return email, nil } addr, err := mail.ParseAddress(email) if err != nil { return "", err } email = addr.Address parts := strings.SplitN(email, "@", 2) if len(parts) < 2 { return "", fmt.Errorf("invalid e. mail address specified") } return dns.Fqdn(parts[0] + "." + parts[1]), nil }