problem with Email::MIME::Attachment::Stripper

Discussion in 'Perl Misc' started by ecureuil, Jun 11, 2006.

  1. ecureuil

    ecureuil Guest

    Hi,

    I have a problem with Email::MIME::Attachment::Stripper.

    with KMail/1.7.x :
    boundary="Boundary-00=_ficdEbM/nb3/GhZ"

    my $message = do { local $/; <> };
    my $parser = Email::MIME->new($message);
    my @parts = $parser->parts();
    $smtp->datasend(sprintf ("There are %d parts in the message\n", $#parts
    +1 ) );

    => There are 3 parts in the message
    It's not ok. 2 parts in this mail, no 3 parts

    $message =>

    Received: (qmail 3807 invoked by alias); 25 May 2006 15:02:12 -0000
    Delivered-To: xxxx
    Received: (qmail 3804 invoked from network); 25 May 2006 15:02:12 -0000
    Received: from pc-00001.xxxxxxxxxxx(HELO xxxxxxxxxxx) (10.97.1.1)
    by maison1.testam.xxxxxxxxxxx (10.97.1.45) with SMTP; 25 May 2006
    15:02:12 -0000
    Received: (qmail 12517 invoked from network); 25 May 2006 15:16:32 -0000
    X-Virus-Scanned: by amavis-ng-0.1.6.4-03dc on tux.xxxxxxxxxxx
    Received: from smtp5-xxx.free.fr (212.xxx.xxx.xxx)
    by tux.xxxxxxxxxxx (82.xxx.xxx.xxx) with ESMTP; 25 May 2006 15:16:19 -0000
    Received: from geo.localdomain (vig38-1-82-xxx.xxx-xxx.fbx.proxad.net
    [82.xxx.xxx.xxx])
    by smtp5-xxx.free.fr (Postfix) with ESMTP id F03591DE91
    for <>; Thu, 25 May 2006 17:02:06 +0200
    (CEST)
    From: Monique =?iso-8859-1?q??= <>
    Reply-To:
    To: xxxxx
    Subject: Re-test
    Date: Thu, 25 May 2006 17:09:19 +0200
    User-Agent: KMail/1.7.1
    MIME-Version: 1.0
    Content-Type: Multipart/Mixed;
    boundary="Boundary-00=_ficdEbM/nb3/GhZ"
    Message-Id: <>

    --Boundary-00=_ficdEbM/nb3/GhZ
    Content-Type: text/plain;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    Content-Disposition: inline

    And now, mylady, with la PJ, enfin j'espere
    =2D-=20
    Monique

    --Boundary-00=_ficdEbM/nb3/GhZ
    Content-Type: image/jpeg;
    name="GateauPavotChocolat.jpg"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment;
    filename="GateauPavotChocolat.jpg"

    /9j/4AAQSkZJRgABAQEASABIAAD//gAXQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAIBgYHBgUI
    ....
    ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER
    ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERF//Z

    --Boundary-00=_ficdEbM/nb3/GhZ--

    my $stripper = Email::MIME::Attachment::Stripper->new($message);
    my @attachments = $stripper->attachments;
    $smtp->datasend(sprintf ("There are %d attachments in the message\n\n",
    $#attachments +1 ) );

    => There are 1 attachments in the message
    It's ok. 1 attachment!

    my Email::MIME $msg = $stripper->message->as_string;
    $smtp->datasend(sprintf( "Attach Message :\n%s\n", $msg));

    Attach Message :

    Received: (qmail 3807 invoked by alias); 25 May 2006 15:02:12 -0000
    Delivered-To: xxxx
    Received: (qmail 3804 invoked from network); 25 May 2006 15:02:12 -0000
    Received: from pc-00001.xxxxxxxxxxx(HELO xxxxxxxxxxx) (10.97.1.1)
    by maison1.testam.xxxxxxxxxxx (10.97.1.45) with SMTP; 25 May 2006
    15:02:12 -0000
    Received: (qmail 12517 invoked from network); 25 May 2006 15:16:32 -0000
    X-Virus-Scanned: by amavis-ng-0.1.6.4-03dc on tux.xxxxxxxxxxx
    Received: from smtp5-xxx.free.fr (212.xxx.xxx.xxx)
    by tux.xxxxxxxxxxx (82.xxx.xxx.xxx) with ESMTP; 25 May 2006 15:16:19 -0000
    Received: from geo.localdomain (vig38-1-82-xxx.xxx-xxx.fbx.proxad.net
    [82.xxx.xxx.xxx])
    by smtp5-xxx.free.fr (Postfix) with ESMTP id F03591DE91
    for <>; Thu, 25 May 2006 17:02:06 +0200
    (CEST)
    From: Monique =?iso-8859-1?q??= <>
    Reply-To:
    To: xxxxx
    Subject: Re-test
    Date: Thu, 25 May 2006 17:09:19 +0200
    User-Agent: KMail/1.7.1
    MIME-Version: 1.0
    Content-Type: Multipart/Mixed;
    boundary="Boundary-00=_ficdEbM/nb3/GhZ"
    Message-Id: <>

    --Boundary-00=_ficdEbM/nb3/GhZ
    Content-Type: text/plain;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    Content-Disposition: inline

    And now, mylady, with la PJ, enfin j'espere
    =2D-=20
    Monique

    --Boundary-00=_ficdEbM/nb3/GhZ

    => It's not ok.

    my Email::MIME $msg1 = $stripper->message;
    my $msg_body = $msg1->body;
    $smtp->datasend(sprintf( "Attach Message body :\n%s\n", $msg_body));
    $smtp->datasend(sprintf( "Attach Message body size : %d Bytes\n", ( length
    ( $msg_body ) ) ) );
    $smtp->datasend(sprintf( "Incoming Mail contentstype : %s\n\n", (
    $msg1->content_type ) ) );

    =>
    Attach Message body :


    Attach Message body size : 1 Bytes
    Incoming Mail contentstype : multipart/mixed;
    boundary="Boundary-00=_ficdEbM/nb3/GhZ"

    I have this problem with kmail 1.7.1 and 1.7.2
    With another mail client, I don't have problem.

    example:
    Content-Type: multipart/mixed; boundary=Apple-Mail-2-621846957
    Content-type: multipart/mixed;
    boundary="Boundary_(ID_7yf+ICrVh+A4LyflJxVCtw)"
    Content-Type: multipart/mixed;
    boundary="------------000402030106050003040902"
    => no problem

    Have you an idea?

    thank you
    anne
    ecureuil, Jun 11, 2006
    #1
    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. Matthew Lenz
    Replies:
    0
    Views:
    520
    Matthew Lenz
    Feb 22, 2005
  2. James
    Replies:
    1
    Views:
    250
    Paul Lalli
    Aug 4, 2004
  3. Arvin Portlock
    Replies:
    0
    Views:
    191
    Arvin Portlock
    May 3, 2006
  4. ecureuil
    Replies:
    0
    Views:
    325
    ecureuil
    May 28, 2006
  5. Ted Byers
    Replies:
    0
    Views:
    252
    Ted Byers
    Mar 20, 2009
Loading...

Share This Page