validate the generated email address and fall back to localhost.localdom...

...ain in case it is not valid

fixes #1844

@karlitschek @Raydiation @LukasReschke @VicDeo THX