modules to detach attachments and form replies?

Discussion in 'Perl Misc' started by Don McLaughlin, Oct 13, 2005.

  1. 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
    Don McLaughlin, Oct 13, 2005
    #1
    1. Advertising

  2. Don McLaughlin

    Paul Lalli Guest

    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-Reply-1.1/lib/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
    Paul Lalli, Oct 13, 2005
    #2
    1. Advertising

  3. > 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-Reply-1.1/lib/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, Oct 13, 2005
    #3
  4. "Paul Lalli" <> 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-Reply-1.1/lib/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
    Don McLaughlin, Oct 14, 2005
    #4
  5. Don McLaughlin

    Paul Lalli Guest

    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
    Paul Lalli, Oct 14, 2005
    #5
  6. > 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
    Don McLaughlin, Oct 16, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?c3N0ZXZlbnM=?=

    Automated Emails and Replies

    =?Utf-8?B?c3N0ZXZlbnM=?=, Jan 24, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    380
    MWells
    Jan 24, 2005
  2. Neredbojias

    More Form Mail Replies - OT

    Neredbojias, Apr 1, 2008, in forum: HTML
    Replies:
    8
    Views:
    454
    John Hosking
    Apr 7, 2008
  3. codewarrior
    Replies:
    0
    Views:
    526
    codewarrior
    May 4, 2009
  4. Peter Green
    Replies:
    0
    Views:
    636
    Peter Green
    Nov 5, 2009
  5. Damjan Rems
    Replies:
    1
    Views:
    231
Loading...

Share This Page