
=head1 NAME

Mail::Box::IMAP4::Message - one message on a IMAP4 server

=head1 CLASS INHERITANCE

 Mail::Box::IMAP4::Message
   is a Mail::Box::Net::Message
   is a Mail::Box::Message
   is a Mail::Message
   is a Mail::Reporter

=head1 SYNOPSIS

 my $folder = new Mail::Box::IMAP4 ...
 my $message = $folder->message(10);

=head1 DESCRIPTION

A Mail::Box::IMAP4::Message represents one message on a IMAP4 server,
maintained by a Mail::Box::IMAP4 folder. Each message is stored as
separate entity on the server, and maybe temporarily in your program
as well.

=head1 METHODS

=head2 Initiation

=over 4

=item B<new> OPTIONS

(Class method)

 OPTION               DEFAULT
 body                 undef
 body_type            'Mail::Message::Body::Lines';
 deleted              <false>
 field_type           undef
 folder               <required>
 head                 undef
 head_type            'Mail::Message::Head::Complete'
 log                  'WARNINGS'
 messageId            undef
 modified             <false>
 size                 undef
 trace                'WARNINGS'
 trusted              <false>
 unique               <unique string>

=over 4

=item B<body> =E<gt> OBJECT

See Mail::Message::new(body)

=item B<body_type> =E<gt> CODE|CLASS

See Mail::Box::Message::new(body_type)

=item B<deleted> =E<gt> BOOLEAN

See Mail::Box::Message::new(deleted)

=item B<field_type> =E<gt> CLASS

See Mail::Message::new(field_type)

=item B<folder> =E<gt> FOLDER

See Mail::Box::Message::new(folder)

=item B<head> =E<gt> OBJECT

See Mail::Message::new(head)

=item B<head_type> =E<gt> CLASS

See Mail::Message::new(head_type)

=item B<log> =E<gt> LEVEL

See Mail::Reporter::new(log)

=item B<messageId> =E<gt> STRING

See Mail::Message::new(messageId)

=item B<modified> =E<gt> BOOLEAN

See Mail::Message::new(modified)

=item B<size> =E<gt> INTEGER

See Mail::Box::Message::new(size)

=item B<trace> =E<gt> LEVEL

See Mail::Reporter::new(trace)

=item B<trusted> =E<gt> BOOLEAN

See Mail::Message::new(trusted)

=item B<unique> =E<gt> STRING

See Mail::Box::Net::Message::new(unique)

=back

=item B<unique> [STRING]

See Mail::Box::Net::Message::unique()

=back

=head2 Constructing a Message

=over 4

=item B<bounce> [RG-OBJECT|OPTIONS]

See Mail::Message::Construct::bounce()

=item B<build> [MESSAGE|BODY], CONTENT

See Mail::Message::Construct::build()

=item B<buildFromBody> BODY, [HEAD], HEADERS

See Mail::Message::Construct::buildFromBody()

=item B<coerce> MESSAGE

See Mail::Box::Message::coerce()

=item B<forward> OPTIONS

See Mail::Message::Construct::forward()

=item B<forwardPostlude> 

See Mail::Message::Construct::forwardPostlude()

=item B<forwardPrelude> 

See Mail::Message::Construct::forwardPrelude()

=item B<forwardSubject> STRING

See Mail::Message::Construct::forwardSubject()

=item B<read> FILEHANDLE|SCALAR|REF-SCALAR|ARRAY-OF-LINES, OPTIONS

See Mail::Message::Construct::read()

=item B<reply> OPTIONS

See Mail::Message::Construct::reply()

=item B<replyPrelude> [STRING|FIELD|ADDRESS]

See Mail::Message::Construct::replyPrelude()

=item B<replySubject> STRING

See Mail::Message::Construct::replySubject()

=back

=head2 The Message

=over 4

=item B<clone> 

See Mail::Message::clone()

=item B<container> 

See Mail::Message::container()

=item B<copyTo> FOLDER

See Mail::Box::Message::copyTo()

=item B<folder> [FOLDER]

See Mail::Box::Message::folder()

=item B<isDummy> 

See Mail::Message::isDummy()

=item B<isModified> 

See Mail::Message::isModified()

=item B<isPart> 

See Mail::Message::isPart()

=item B<messageId> 

See Mail::Message::messageId()

=item B<modified> [BOOLEAN]

See Mail::Message::modified()

=item B<moveTo> FOLDER

See Mail::Box::Message::moveTo()

=item B<print> [FILEHANDLE]

See Mail::Message::print()

=item B<send> [MAILER], OPTIONS

See Mail::Message::send()

=item B<seqnr> [INTEGER]

See Mail::Box::Message::seqnr()

=item B<size> 

Returns the size of this message.  If the message is still on the remote
server, POP is used to ask for the size.  When the message is already loaded
onto the local system, the size of the parsed message is taken.  These
sizes can differ because the difference in line-ending representation.

=item B<toplevel> 

See Mail::Message::toplevel()

=item B<write> [FILEHANDLE]

See Mail::Message::write()

=back

=head2 The Header

=over 4

=item B<head> [HEAD]

See Mail::Message::head()

=back

=head2 Header Shortcuts

=over 4

=item B<bcc> 

See Mail::Message::bcc()

=item B<cc> 

See Mail::Message::cc()

=item B<date> 

See Mail::Message::date()

=item B<destinations> 

See Mail::Message::destinations()

=item B<from> 

See Mail::Message::from()

=item B<get> FIELD

See Mail::Message::get()

=item B<guessTimestamp> 

See Mail::Message::guessTimestamp()

=item B<nrLines> 

See Mail::Message::nrLines()

=item B<sender> 

See Mail::Message::sender()

=item B<subject> 

See Mail::Message::subject()

=item B<timestamp> 

See Mail::Message::timestamp()

=item B<to> 

See Mail::Message::to()

=back

=head2 The Body

=over 4

=item B<body> [BODY]

See Mail::Message::body()

=item B<decoded> OPTIONS

See Mail::Message::decoded()

=item B<encode> OPTIONS

See Mail::Message::encode()

=item B<isMultipart> 

See Mail::Message::isMultipart()

=item B<parts> ['ALL'|'ACTIVE'|'DELETED'|'RECURSE'|FILTER]

See Mail::Message::parts()

=back

=head2 Access to the Message

=over 4

=item B<file> 

See Mail::Message::Construct::file()

=item B<lines> 

See Mail::Message::Construct::lines()

=item B<string> 

See Mail::Message::Construct::string()

=back

=head2 Labels

=over 4

=item B<delete> 

See Mail::Box::Message::delete()

=item B<deleted> [BOOLEAN]

See Mail::Box::Message::deleted()

=item B<isDeleted> 

See Mail::Box::Message::isDeleted()

=item B<label> LABEL, [VALUE, [LABEL, VALUE, ...]]

With only one argument, the value related to LABEL is returned.  With
more that one argument, the list is interpreted a LABEL-VALUE pairs
to be set.

The IMAP protocol defines its own names for the labels, which must
be set imediately to inform other IMAP clients which may have the
same folder open.  Some labels are translated to the corresponding
IMAP system labels.

=item B<labels> 

See Mail::Message::labels()

=item B<labelsToStatus> 

See Mail::Message::labelsToStatus()

=item B<statusToLabels> 

See Mail::Message::statusToLabels()

=back

=head2 Reading and Writing [internals]

=over 4

=item B<DESTROY> 

See Mail::Message::DESTROY()

=item B<diskDelete> 

See Mail::Box::Message::diskDelete()

=item B<isDelayed> 

See Mail::Message::isDelayed()

=item B<loadBody> 

See Mail::Box::Net::Message::loadBody()

=item B<readBody> PARSER, HEAD [, BODYTYPE]

See Mail::Box::Message::readBody()

=item B<readFromParser> PARSER, [BODYTYPE]

See Mail::Message::readFromParser()

=item B<readHead> PARSER [,CLASS]

See Mail::Message::readHead()

=item B<storeBody> BODY

See Mail::Message::storeBody()

=item B<takeMessageId> [STRING]

See Mail::Message::takeMessageId()

=back

=head2 Logging and Tracing

=over 4

=item B<defaultTrace> [LEVEL, [LEVEL]

See Mail::Reporter::defaultTrace()

=item B<errors> 

See Mail::Reporter::errors()

=item B<log> [LEVEL [,STRINGS]]

See Mail::Reporter::log()

=item B<printStructure> [FILEHANDLE][, INDENT]

See Mail::Message::Construct::printStructure()

=item B<report> [LEVEL]

See Mail::Reporter::report()

=item B<reportAll> [LEVEL]

See Mail::Reporter::reportAll()

=item B<shortString> 

See Mail::Box::Message::shortString()

=item B<trace> [LEVEL]

See Mail::Reporter::trace()

=item B<warnings> 

See Mail::Reporter::warnings()

=back

=head2 Other Methods

=over 4

=item B<AUTOLOAD> 

See Mail::Reporter::AUTOLOAD()

=item B<inGlobalDestruction> 

See Mail::Reporter::inGlobalDestruction()

=item B<logPriority> LEVEL

See Mail::Reporter::logPriority()

=item B<logSettings> 

See Mail::Reporter::logSettings()

=item B<notImplemented> 

See Mail::Reporter::notImplemented()

=back

=head1 SEE ALSO

A good start to read is Mail::Box-Overview.
More documentation and a mailinglist are available from the project's
website at L<http://perl.overmeer.net/mailbox/>.

=head1 AUTHOR

Written by Mark Overmeer (L<mark@overmeer.net|mailto:mark@overmeer.net>)
with the help of many.  See the ChangeLog for details.

=head1 VERSION

This code is beta, version 2.037.

Copyright (c) 2001-2003 by the authors. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
