[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-mailbox
Subject:    Problems detecting multipart messages
From:       Evan Borgstrom <evan () unixpimps ! org>
Date:       2002-06-17 15:00:21
[Download RAW message or body]

Hey all,

I'm having problems getting the multipart detection working in the Mail::Box 
libraries. Esentially I have a message I know is multipart but no matter how I 
parse it, it never gets detected as multipart.

Here's a snippet of the headers:

MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="part1_1a9.3ba9514.2a3cf8f5_boundary"
X-Mailer: AOL 7.0 for Windows US sub 121
Subject: Re: [ragga-jungle] what do you think??

--part1_1a9.3ba9514.2a3cf8f5_boundary
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit


And here's a synopsis of the code I'm using:

The message gets piped to the script (via qmail's .qmail mechanisim, it works 
just like procmail)

my $msg_in      = Mail::Message->read(\*STDIN);

if ($msg_in->get('Content-Type') =~ /multipart/) { returns TRUE }
if ($msg_in->isMultipart())			 { returns FALSE }
if ($msg_in->body->isMultipart())		 { returns FALSE }

Now the interesting thing is that when you print $msg_in->get('Content-Type') 
all you get back is "multipart/alternative", the semi-colon and everything 
beyond has been stripped so I can't even dig appart the parts on my own.


The other thing I tried was I copied my ./Mailbox to a new file and appended 
this message to the end and then setup this bit of code to get the messages:

use Mail::Box::Manager 2.00;
my $mgr = Mail::Box::Manager->new;
my $folder = $mgr->open(folder => './Mailbox-new', extract => 'LAZY');
my @messages = $folder->messages;
print "Mail folder contains ", scalar @messages, " messages\n";
my $message = $folder->messages((scalar @messages) - 1);

The three tests above still return the same values (print $message->head 
confirms I'm looking at the right message).


Anyone got any advice.


Cheers,
Evan

-- 
Evan Borgstrom <evan@unixpimps.org>
UNIXPIMPS.ORG - SIG:ILL


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic