Out of curiousity, have you tried seeing what Mail::Message makes of it? (Not suggesting that your $job would let you switch, just curious about the side-by-side comparison on the same, broken email.)
My frequent worry about Email::Simple is that it might be too simple in how it deals with things that aren't standards compliant. I've had good luck with Mail::Message in the past -- I've accepted its heavier weight and learning curve for the robustness I've seen on broken emails.
The following code should be a quick test if you've got it installed. (Read STDIN, print addresses to STDOUT).
use strict; use warnings; use Mail::Message; local $\ = "\n"; my $msg = Mail::Message->read(\*STDIN); print $_->format for $msg->to;
Update: I went ahead and quickly tried it on a sample email -- adding an extra "to:" header after all the other headers. The sample code above gave both the "To:" and "to:" addresses.
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
In reply to Re: Spammers exploiting Email::Simple
by xdg
in thread Spammers exploiting Email::Simple
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |