Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > problem with Email::MIME::Attachment::Stripper

Reply
Thread Tools

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

 
 
ecureuil
Guest
Posts: n/a
 
      06-11-2006
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: http://www.velocityreviews.com/forums/(E-Mail Removed)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 <(E-Mail Removed)>; Thu, 25 May 2006 17:02:06 +0200
(CEST)
From: Monique =?iso-8859-1?q??= <(E-Mail Removed)>
Reply-To: (E-Mail Removed)
To: (E-Mail Removed)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: <(E-Mail Removed)>

--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
....
ERERERERERERERERERERERERERERERERERERERERERERERERER ERERERERERERERERERERERERER
ERERERERERERERERERERERERERERERERERERERERERERERERER ERERERERERERERERERF//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: (E-Mail Removed)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 <(E-Mail Removed)>; Thu, 25 May 2006 17:02:06 +0200
(CEST)
From: Monique =?iso-8859-1?q??= <(E-Mail Removed)>
Reply-To: (E-Mail Removed)
To: (E-Mail Removed)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: <(E-Mail Removed)>

--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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem problem problem :( Need Help Mike ASP General 2 05-11-2004 08:36 AM



Advertisments