in reply to Odd MIME::Parser STDIN behavior
It seems a little unclear on what exactly is going wrong. The way I read this is you are getting the email on STDIN from the mail server, and you can get it on STDIN from `cat` but MIME::Parser doesn't give a message back *ever*. So if that interpretation is wrong anything further I have to say may be baseless :)
Your first loop reads in the message up to and including the From: line, then MIME::Parser starts at the line *after* 'From:'. Any number of headers (including all headers) could have been discarded by that point so the entity from MIME::Parser won't be the complete message, you probably want to start by parsing the message then getting the From header directly from $entity. I'd also like to point out that From headers can be easily forged so relying on them for security would seem flawed.
|
|---|