Refactored mail config