You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Charlie Smith <Sm...@ldschurch.org> on 2006/04/06 17:57:47 UTC
Mail::POP3Client and pdf decode
I'm trying to decode an email that was pop'd. After writing
the body to a disk file using the perl Mail::POP3Client routine
$pop->BodyToFile( $fh, 1);
It looks all like text. So, I run following command to translate
body of mime message back to pdf for reading.
perl -MMIME::Base64 -ne 'print decode_base64($_)' <test.txt >test.pdf
No error messages, but file size is different from original file poped
from email attachment. When pdf file is brought up in browser, there
is no data.
Charlie
4/6/06
Not sure if this is the right list. If not please let me know correct list.
------------------------------------------------------------------------------
NOTICE: This email message is for the sole use of the
intended recipient(s) and may contain confidential and
privileged information. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the
intended recipient, please contact the sender by reply email
and destroy all copies of the original message.
------------------------------------------------------------------------------
Re: Mail::POP3Client and pdf decode
Posted by "JupiterHost.Net" <ml...@jupiterhost.net>.
Charlie Smith wrote:
> I'm trying to decode an email that was pop'd. After writing
> the body to a disk file using the perl Mail::POP3Client routine
> $pop->BodyToFile( $fh, 1);
>
> It looks all like text. So, I run following command to translate
by "it looks all like text" do you mean its "like words" or "an ascii
armoured" string?
> body of mime message back to pdf for reading.
> perl -MMIME::Base64 -ne 'print decode_base64($_)' <test.txt >test.pdf
test.txt is base64 encoded verison correct?
does it have anytyhing in it that is not part of the encoding?
If so then you're decoding that line and putting it in the pdf file
After making sure test.txt is clean:
perl -mstrict -MFile::Slurp -MMIME::Base64 -we 'my $b64 =
read_file("test.txt");write_file("test.pdf", decode_base64($b64));'
It cortaks if one of them fail so you're all set AFA error checking...
> No error messages, but file size is different from original file poped
Yes, the base 64 encoded verison will be a differtent size than the guts
that were encoded...
> from email attachment. When pdf file is brought up in browser, there
> is no data.
- Is the decoded version 0 in size?
- are you outputting a header to tell the browser its a PDF?
- any errors in screen, logs, etc
Example code and url's to the symptoms would be extrememly handy to
diagnose the problem, no?
Re: Mail::POP3Client and pdf decode
Posted by Charlie Smith <Sm...@ldschurch.org>.
Using cpan shell or webmin, I get following errro on attempt install
XML::DOM, so the whole install blows up.
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/dom_jp_print.t 3 1 33.33% 2
Please assist.
Charlie
------------------------------------------------------------------------------
NOTICE: This email message is for the sole use of the
intended recipient(s) and may contain confidential and
privileged information. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the
intended recipient, please contact the sender by reply email
and destroy all copies of the original message.
------------------------------------------------------------------------------
Re: XML::DOM no compile
Posted by Perrin Harkins <pe...@elem.com>.
Hi Charlie,
> Using cpan shell or webmin, I get following errro on attempt install
> XML::DOM, so the whole install blows up.
This mailing list is specifically for discussion of mod_perl. For
general Perl questions, try one of the places listed here:
http://perl.apache.org/docs/offsite/other.html#Perl
- Perrin
XML::DOM no compile
Posted by Charlie Smith <Sm...@ldschurch.org>.
Using cpan shell or webmin, I get following errro on attempt install
XML::DOM, so the whole install blows up.
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/dom_jp_print.t 3 1 33.33% 2
Please assist.
Charlie
------------------------------------------------------------------------------
NOTICE: This email message is for the sole use of the
intended recipient(s) and may contain confidential and
privileged information. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the
intended recipient, please contact the sender by reply email
and destroy all copies of the original message.
------------------------------------------------------------------------------
Re: Mail::POP3Client and pdf decode
Posted by Perrin Harkins <pe...@elem.com>.
On Thu, 2006-04-06 at 09:57 -0600, Charlie Smith wrote:
> Not sure if this is the right list. If not please let me know correct list.
This list if for discussion of mod_perl, not for general Perl questions.
For general Perl help, see the resources listed here:
http://perl.apache.org/docs/offsite/other.html
- Perrin