logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: Multipart parsing (Re: Mail Box doesn't opens specified dir): msg#00000

Subject: Re: Multipart parsing (Re: Mail Box doesn't opens specified dir)
Thanks a lot :)
Nested is that I need for :)))

Asta

----- Original Message -----
From: "Mark Overmeer" <mark@xxxxxxxxxxxx>
To: "asta" <asta@xxxxxxxxxxxxxx>
Cc: "Mail-Box Mailinglist" <mailbox@xxxxxxxxxxxxxxxxx>
Sent: Friday, November 28, 2003 5:29 PM
Subject: Re: Multipart parsing (Re: Mail Box doesn't opens specified dir)


> * asta (asta@xxxxxxxxxxxxxx) [031128 15:57]:
> > here it is one of them :)
>
> > ----- Original Message -----
> > From: "Mark Overmeer" <mark@xxxxxxxxxxxx>
> > To: "asta" <asta@xxxxxxxxxxxxxx>
> > > Please privide me with one of your messages (off-list), and I show you
> > > how to get the data.
>
> The reason is that $msg->parts produces all the message parts which are
> not the multipart containers and not the message/rfc822 encapsulations.
> So: only the parts containing data.  In your case, the additional 'to'
> addresses you where looking for where in message/rfc822 headers...
>
> The following code works:
>
>   my $msg = $folder->message(...);
>   $msg->printStructure;
>
>   my @to;
>
>   sub collect_to($)
>   {   my $part = shift;
>       if(my $to = $part->head->get('to'))
>       {   push @to, $to->addresses;
>       }
>
>       if($part->isMultipart) { collect_to($_) for $part->body->parts }
>       elsif($part->isNested) { collect_to($part->body->nested) }
>   }
>
>   collect_to($msg);
>   print $_->format, "\n" foreach @to;
>
> Your own recursive message search.
> --
>                MarkOv
>
> ------------------------------------------------------------------------
> drs Mark A.C.J. Overmeer                                MARKOV Solutions
>        Mark@xxxxxxxxxxxx                          solutions@xxxxxxxxxxxx
> http://Mark.Overmeer.net                   http://solutions.overmeer.net





<Prev in Thread] Current Thread [Next in Thread>