Ref T10121. If a user sends mail with duplicate headers, like:
X-Duplicate: A X-Duplicate: B
...and we process it with mail_handler.php, we may end up with array('A', 'B') as the header value. When we try to write this back into an error response mail, it fails.