Added mail settings service, moved settings to db