Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   modules to detach attachments and form replies? (http://www.velocityreviews.com/forums/t894690-modules-to-detach-attachments-and-form-replies.html)

Don McLaughlin 10-13-2005 04:06 PM

modules to detach attachments and form replies?
 
I've looked at CPAN's Mail and News sections and couldn't find what I
needed so I'd appreciate any pointers to modules or sample code.

(1) I'm sure I've seen a module somewhere for separating MIME parts of
e-mails, but I can't find it now. I want to strip away everything else
and retain just the plain text part.

(2) I want to form a reply mail/news body from an original body, in
other words turn

From: Alice ...

> Bob wrote:
>
> What's going on?


I don't know

into

Alice wrote:
>
> > Bob wrote:
> >
> > What's going on?

>
> I don't know


so I can add a reply to the end. I'm sure this is a standard thing so
I'm surprised I haven't seen anything to do it. News::AutoReply
transforms the headers into a reply but leaves the body empty. I'm
looking for something to do the body only or both the body and the
headers.

Thanks,
Don



Paul Lalli 10-13-2005 04:49 PM

Re: modules to detach attachments and form replies?
 
Don McLaughlin wrote:
> I've looked at CPAN's Mail and News sections and couldn't find what I
> needed so I'd appreciate any pointers to modules or sample code.
>
> (1) I'm sure I've seen a module somewhere for separating MIME parts of
> e-mails, but I can't find it now. I want to strip away everything else
> and retain just the plain text part.


Odd. When I go to http://search.cpan.org, and search for 'Email Mime',
the third result is:
http://search.cpan.org/~cwest/Email-MIME-1.82/MIME.pm
which seems to do exactly what you wanted.

> (2) I want to form a reply mail/news body from an original body, in
> other words turn
>
> From: Alice ...
>
> > Bob wrote:
> >
> > What's going on?

>
> I don't know
>
> into
>
> Alice wrote:
> >
> > > Bob wrote:
> > >
> > > What's going on?

> >
> > I don't know

>
> so I can add a reply to the end. I'm sure this is a standard thing so
> I'm surprised I haven't seen anything to do it.


Odd. When I go to http://search.cpan.org, and search for 'Reply', the
very first thing listed is:
http://search.cpan.org/~cwest/Email-...Email/Reply.pm
which seems to do exactly what you asked for.

Now, this is not *entirely* you're fault. As has been recently
discussed in another thread, the browse-by-category feature of CPAN
seems to be lacking, in that not every module which falls into a given
category is listed. But please, in the future, at least *try* to
search on some keywords.

Paul Lalli


Don McLaughlin 10-13-2005 09:51 PM

Re: modules to detach attachments and form replies?
 
> Odd. When I go to http://search.cpan.org, and search for 'Email Mime',
> the third result is:
> http://search.cpan.org/~cwest/Email-MIME-1.82/MIME.pm
> which seems to do exactly what you wanted.


Looks perfect, thanks.

> Odd. When I go to http://search.cpan.org, and search for 'Reply', the
> very first thing listed is:
> http://search.cpan.org/~cwest/Email-...Email/Reply.pm
> which seems to do exactly what you asked for.


Thanks again.

> Now, this is not *entirely* you're fault.


Sorry about the part this is my fault! I appreciate your patience.

> As has been recently
> discussed in another thread, the browse-by-category feature of CPAN
> seems to be lacking, in that not every module which falls into a given
> category is listed. But please, in the future, at least *try* to
> search on some keywords.


Hmm. Several times in the past I've had lousy luck with keyword
searches so recently I've been using the categories. I'd better try
both in the future.

Thanks for your help,
Don



Don McLaughlin 10-14-2005 11:24 AM

Re: modules to detach attachments and form replies?
 
"Paul Lalli" <mritty@gmail.com> wrote:

> Odd. When I go to http://search.cpan.org, and search for 'Email Mime',
> the third result is:
> http://search.cpan.org/~cwest/Email-MIME-1.82/MIME.pm
> which seems to do exactly what you wanted.


So far so good.

> Odd. When I go to http://search.cpan.org, and search for 'Reply', the
> very first thing listed is:
> http://search.cpan.org/~cwest/Email-...Email/Reply.pm
> which seems to do exactly what you asked for.


# perl -MCPAN -e 'install Email::Reply'

..

Checking if your kit is complete...
Looks good
Writing Makefile for Email::Reply
cp lib/Email/Reply.pm blib/lib/Email/Reply.pm
Manifying blib/man3/Email::Reply.3pm
/usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/test....NOK 7# Failed test (t/test.t at line 63)

..

t/test....ok 8/0# Looks like you failed 1 tests of 8.
t/test....dubious
Test returned status 1 (wstat 256, 0x100)
DIED. FAILED test 7
Failed 1/8 tests, 87.50% okay
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/test.t 1 256 8 1 12.50% 7
Failed 1/1 test scripts, 0.00% okay. 1/8 subtests failed, 87.50% okay.
make: *** [test_dynamic] Error 2
/usr/bin/make test -- NOT OK
Running make install
make test had returned bad status, won't install without force


I'd appreciate suggestions on how to fix this!

Thanks,
Don



Paul Lalli 10-14-2005 06:50 PM

Re: modules to detach attachments and form replies?
 
Don McLaughlin wrote:
>
> # perl -MCPAN -e 'install Email::Reply'
>
> Checking if your kit is complete...
> Looks good
> Writing Makefile for Email::Reply
> cp lib/Email/Reply.pm blib/lib/Email/Reply.pm
> Manifying blib/man3/Email::Reply.3pm
> /usr/bin/make -- OK
> Running make test
> PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
> t/test....NOK 7# Failed test (t/test.t at line 63)
>
> .
>


When I run this, it prints out a rather lengthy explanation of why the
test failed. Did you snip that explanation, thinking it wasn't
important?

>From what I can tell, the only difference between what the test

"expected" and what the code actually produced are these lines:
Content-Type: multipart/mixed; boundary="boundary42";
charset="us-ascii"
Content-Type: multipart/mixed; charset="us-ascii";
boundary="boundary42"

I admit to not knowing the mail format proticols that well, but I'm
*guessing* this doesn't make a difference. I'd suggest it'd be okay
to go ahead and force the installation, even with this failed test.

perl -MCPAN -e'force install Email::Reply'

Paul Lalli


Don McLaughlin 10-16-2005 08:15 PM

Re: modules to detach attachments and form replies?
 
> When I run this, it prints out a rather lengthy explanation of why the
> test failed. Did you snip that explanation, thinking it wasn't
> important?


I thought I'd get buzzed for posting that big a dump. Also, I couldn't
find the specific error in it.

> >From what I can tell, the only difference between what the test

> "expected" and what the code actually produced are these lines:
> Content-Type: multipart/mixed; boundary="boundary42";
> charset="us-ascii"
> Content-Type: multipart/mixed; charset="us-ascii";
> boundary="boundary42"


I think that my problem is similar.

> I admit to not knowing the mail format proticols that well, but I'm
> *guessing* this doesn't make a difference. I'd suggest it'd be okay
> to go ahead and force the installation, even with this failed test.
>
> perl -MCPAN -e'force install Email::Reply'


I couldn't get that to work (I got the same refusal message as before)
but I got it with this:

perl -MCPAN -e shell
cpan> force install Email::Reply

Hope it works!

Thanks for all your help,
Don




All times are GMT. The time now is 01:12 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.