improvements to the way that the mail command works