Writing mailbox properly