tests and fix for MailHandler.receive