adding check for config.email.auth undefined