=head1 NAME

Mail::IMAPClient::BodyStructure - parse fetched results

=head1 SYNOPSIS

  use Mail::IMAPClient::BodyStructure;
  use Mail::IMAPClient;

  my $imap = Mail::IMAPClient->new(Server=>$serv,User=>$usr,Password=>$pwd);
  $imap->select("INBOX") or die "cannot select the inbox for $usr: $@\n";

  my @recent = $imap->search("recent");

  foreach my $id (@recent)
  {   my $fetched = $imap->fetch($id, "bodystructure");
      my $struct = Mail::IMAPClient::BodyStructure->new($fetched);

      my $mime   = $struct->bodytype."/".$struct->bodysubtype;
      my $parts  =join "\n\t", $struct->parts;
      print "Msg $id (Content-type: $mime) contains these parts:\n\t$parts\n";
  }

=head1 DESCRIPTION

This extension will parse the result of an IMAP FETCH BODYSTRUCTURE
command into a perl data structure. It also provides helper methods that
will help you pull information out of the data structure.

Use of this extension requires Parse::RecDescent. If you don't have
Parse::RecDescent then you must either get it or refrain from using
this module.

=head2 EXPORT

Nothing is exported by default. C<$parser> is exported upon
request. C<$parser> is the BodyStucture object's Parse::RecDescent object,
which you'll probably only need for debugging purposes.

=head1 SEE ALSO

This module is part of Mail-IMAPClient distribution version 3.07,
built on April 28, 2008.

=head1 LICENSE

Copyrights 2008. For other contributors see Changes.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
See F<http://www.perl.com/perl/misc/Artistic.html>

