gadded missing $group and email check

if the username is an email-address the email-adress can be omitted.
The username name gets checked and if it is a valid email-address the
this value will be used.