add mail config from yml-file, and refractoring user model