tool: Handle mail log includes invalid byte sequence properly

GitHub: fixes #24

Reported by Satoru Sakashita. Thanks!!!