
=head1 NAME

Mail::Message::Field::Unstructured - unstructured "Full" field

=head1 CLASS INHERITANCE

 Mail::Message::Field::Unstructured
   is a Mail::Message::Field::Full
   is a Mail::Message::Field
   is a Mail::Reporter

=head1 SYNOPSIS

 my $f = Mail::Message::Field::Unstructured->new(Comments => 'hi!');

=head1 DESCRIPTION

Unstructured fields do contain information which is not restricted in
any way.  RFC2822 defines some unstructured fields, but by default all
unknown fields are unstructured as well.  Things like attributes and
comments have no meaning for unstructured fields, but encoding does.

=head1 METHODS

=head2 Initiation

=over 4

=item B<from> FIELD, OPTIONS

See Mail::Message::Field::Full::from()

=item B<new> DATA

(Class method) 

When the DATA is specified as single line, the content part is considered to
be correcly (character) encoded and escaped.  Typically, it is a line as
read from file.  The folding of the line is kept as is.

In case more than one argument is provided, the second is considered the BODY.
Attributes and other special things are not defined for unstructured fields,
and therefore not valid options.  The BODY can be a single string, a single
OBJECT, or an array of OBJECTS.  The objects are stringified (into a comma
separated list).  Each BODY element is interpreted with the specified encoding.

When the BODY is empty, the construction of the object fails: C<undef> is
returned.

 OPTION               DEFAULT
 attributes           C<not accepted>
 charset              C<undef>
 encoding             'q'
 extra                C<not accepted>
 force                false
 is_structured        0
 language             C<undef>
 log                  'WARNINGS'
 trace                'WARNINGS'

=over 4

=item B<attributes> =E<gt> ATTRS

See Mail::Message::Field::Full::new(attributes)

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

See Mail::Message::Field::Full::new(charset)

=item B<encoding> =E<gt> 'q'|'Q'|'b'|'B'

See Mail::Message::Field::Full::new(encoding)

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

See Mail::Message::Field::Full::new(extra)

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

See Mail::Message::Field::Full::new(force)

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

See Mail::Message::Field::Full::new(is_structured)

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

See Mail::Message::Field::Full::new(language)

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

See Mail::Reporter::new(log)

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

See Mail::Reporter::new(trace)

=back

Examples:

 my $s = Mail::Message::Field::Unstructured->new('Comment: Hi!');
 my $s = Mail::Message::Field::Unstructured->new('Comment', 'Hi!');

 # Use autodetect
 my $s = Mail::Message::Field::Full->new('Comment', 'Hi!');
 my $s = Mail::Message::Field::Full->new('Comment: Hi!');

=back

=head2 The Field

=over 4

=item B<addAttribute> ...

Attributes are not supported for unstructured fields.

=item B<addComment> ...

Comments are not supported for unstructured fields.

=item B<addExtra> ...

Extras are not supported for unstructured fields.

=item B<addPhrase> STRING, OPTIONS

See Mail::Message::Field::Full::addPhrase()

=item B<attributes> 

See Mail::Message::Field::Full::attributes()

=item B<clone> 

See Mail::Message::Field::clone()

=item B<createComment> STRING, OPTIONS

See Mail::Message::Field::Full::createComment()

=item B<createPhrase> STRING, OPTIONS

See Mail::Message::Field::Full::createPhrase()

=item B<isStructured> 

See Mail::Message::Field::isStructured()

=item B<length> 

See Mail::Message::Field::length()

=back

=head2 Access to the Field

=over 4

=item B<Name> 

See Mail::Message::Field::Name()

=item B<addresses> 

See Mail::Message::Field::addresses()

=item B<attribute> NAME [, VALUE]

See Mail::Message::Field::attribute()

=item B<body> 

See Mail::Message::Field::body()

=item B<comment> [STRING]

See Mail::Message::Field::comment()

=item B<dateToTimestamp> STRING

See Mail::Message::Field::dateToTimestamp()

=item B<decodedBody> OPTIONS

See Mail::Message::Field::Full::decodedBody()

=item B<folded> 

See Mail::Message::Field::folded()

=item B<foldedBody> [BODY]

See Mail::Message::Field::foldedBody()

=item B<name> 

See Mail::Message::Field::name()

=item B<nrLines> 

See Mail::Message::Field::nrLines()

=item B<print> [FILEHANDLE]

See Mail::Message::Field::print()

=item B<size> 

See Mail::Message::Field::size()

=item B<string> [WRAP]

See Mail::Message::Field::string()

=item B<stripCFWS> [STRING]

See Mail::Message::Field::stripCFWS()

=item B<toDate> [TIME]

See Mail::Message::Field::toDate()

=item B<toDisclose> 

See Mail::Message::Field::toDisclose()

=item B<toInt> 

See Mail::Message::Field::toInt()

=item B<unfoldedBody> [BODY, [WRAP]]

See Mail::Message::Field::unfoldedBody()

=item B<wellformedName> [STRING]

See Mail::Message::Field::wellformedName()

=back

=head2 Reading and Writing [internals]

=over 4

=item B<consume> LINE | (NAME,BODY|OBJECTS)

See Mail::Message::Field::consume()

=item B<consumeComment> STRING

See Mail::Message::Field::Full::consumeComment()

=item B<consumeDotAtom> STRING

See Mail::Message::Field::Full::consumeDotAtom()

=item B<consumePhrase> STRING

See Mail::Message::Field::Full::consumePhrase()

=item B<decode> STRING, OPTIONS

See Mail::Message::Field::Full::decode()

=item B<defaultWrapLength> [LENGTH]

See Mail::Message::Field::defaultWrapLength()

=item B<encode> STRING, OPTIONS

See Mail::Message::Field::Full::encode()

=item B<fold> NAME, BODY, [MAXCHARS]

See Mail::Message::Field::fold()

=item B<setWrapLength> [LENGTH]

See Mail::Message::Field::setWrapLength()

=item B<unfold> STRING

See Mail::Message::Field::unfold()

=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<report> [LEVEL]

See Mail::Reporter::report()

=item B<reportAll> [LEVEL]

See Mail::Reporter::reportAll()

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

See Mail::Reporter::DESTROY()

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