Unit tests would help catch regressions if this was code to stay.  But we'll remove this as soon as all emails that predate the deployment of this code have been processed.

The main risk in this code is emails with a different structure than the one expected (multi-part e-mail with the original sender address being the first 'email-like' thing in the first part).  I can easily generate an email that breaks this assumption and make a test fail, but that would be irrelevant unless that's an anomaly we'll meet in real forwarded emails.