mailer config refactoring