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.


In reply to Re: Odd MIME::Parser STDIN behavior by tedrek
in thread Odd MIME::Parser STDIN behavior by SpritusMaximus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.