in reply to saving pdf attachments

What are you using to parse your mail messages? Also if you save/cut and paste the whole message into a doc.zip, you should be able to open it with WinZip (GOK as to why) and see all the parts. Check you can do the extract to a valid PDF just to be sure you have valid attachments.

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Replies are listed 'Best First'.
Re: Re: saving pdf attachments
by busch4al (Novice) on Feb 27, 2003 at 14:56 UTC
    Hi Tachyon, I am using my own MimeReader.pm (I got frustrated trying to get Mime::Tools to work.) I have
    all the parts and can save binary, text, quoted-printable (usually, just having trouble with pdfs).
    I did take the email in Outlook and saved the troublesome attachment, and it is valid. I also compared that file to the
    one I save (that doesn't work), and found that the line-endings are the probable problem. Just not sure what about them
    is wrong.

      OK so the problem is that your MimeReader.pm can not cope with what the MIME it is getting.

      You probably are not parsing the corrupt MIME that some mail clients send 'correctly'! I have a webmail app with its own MIME parser built in. It has proven pretty reliable in practice at extracting attachemnts. Drop me a line and I will send you the code. Email jfreeman@tassie.net.au

      cheers

      tachyon

      s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

        Hi Tachyon, I figured out the problem. For pdf files at least, the quoted-printable format was missing an "=" at the end of one or two lines. So, when I ran it through the MIME::QuotedPrint::decode_qp, the extra control-M (\r) was getting stripped. I'm not sure why it works, but I'm doing a s/\n$/\r\n/ on lines that don't end with =.

        Thanks for all the help to everyone!

        busch4al