in reply to Finding e-mail headers

There are a whole host of email handling packages on CPAN, and they really are the easiest way.

If you don't want to use modules, you're asking for a World of Pain, but the RFCs are there to help.
Look at RFCs 822 and more importantly 2822 for a detailed description of Internet Messages (i.e. email).

Once again, I really suggest you use the robust modules from CPAN, rather than try it yourself.

If the information in this post is inaccurate, or just plain wrong, don't just downvote - please post explaining what's wrong.
That way everyone learns.

Replies are listed 'Best First'.
Re: Re: Finding e-mail headers
by AssFace (Pilgrim) on Jun 30, 2003 at 18:29 UTC
    I would love to and perhaps even enjoy using any one of the CPAN modules provided they worked on the mail. I looked through them and tried the MailTools, and that (being what my previous thread that I referenced) failed and I don't know why.

    Were I to know why, it would make life easier, but that module apparently doesn't have any error handling. It just dies quietly and peacefully, leaving me wondering what it doesn't like about the files.

    If I had to guess, I would guess that Windows gets an "\r" in there and that breaks it - but I haven't had time today to go and test out that theory (removing any "\r" in there and then trying to grab the headers with Mail::Internet and/or its Mail::Header.

    If you have a specific module in mind that you think would work, even if MailTools fails, I'm all ears.
    I am just a little gun shy to go running and out and trying them all (I am on Windows and using ActiveState, which IMO is more annoying than using Perl in a *nix environment) and not having any of them work - leaving my exactly where I was, but having spent a lot of time learning which ones don't work and nothing else.

    I did attempt to look over the RFCs for the email, but the depth of reading was hard for me to justify for a script that is in the end to track spam stats on our mail server.
    I am hoping that someone that is already far more knowledgable about it would be willing to pipe up and save me the time, but if not, perhaps I will be doing this in my free time then, rather than on the clock at work since they have a stack of other things I need to get done first.

    There are some odd things afoot now, in the Villa Straylight.