Refactor mailbox configuration