check for email fqdn

trunk
vilmibm 2023-03-01 00:33:08 +00:00
parent add10cb754
commit cec7ee4a82
1 changed files with 5 additions and 1 deletions

View File

@ -93,7 +93,11 @@ func promptEmail(defaultEmail string) (email string, err error) {
email := val.(string)
_, err := mail.ParseAddress(email)
if err != nil {
return fmt.Errorf("could not understand that email: %w", err)
return fmt.Errorf("'%s' doesn't look like an email: %w", email, err)
}
if !strings.Contains(email, ".") {
return fmt.Errorf("'%s' doesn't look like an email: domain not fully qualified", email)
}
return nil