mailer refactor and posting mail restrictions