The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

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

CLASS INHERITANCE

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

SYNOPSIS

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

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.

METHODS

Initiation

from FIELD, OPTIONS

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

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: 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'
attributes => ATTRS

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

charset => STRING

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

encoding => 'q'|'Q'|'b'|'B'

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

extra => STRING

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

force => BOOLEAN

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

is_structured => BOOLEAN

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

language => STRING

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

log => LEVEL

See Mail::Reporter::new(log)

trace => LEVEL

See Mail::Reporter::new(trace)

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!');

The Field

addAttribute ...

Attributes are not supported for unstructured fields.

addComment ...

Comments are not supported for unstructured fields.

addExtra ...

Extras are not supported for unstructured fields.

addPhrase STRING, OPTIONS

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

attributes

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

clone

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

createComment STRING, OPTIONS

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

createPhrase STRING, OPTIONS

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

isStructured

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

length

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

Access to the Field

Name

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

addresses

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

attribute NAME [, VALUE]

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

body

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

comment [STRING]

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

dateToTimestamp STRING

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

decodedBody OPTIONS

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

folded

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

foldedBody [BODY]

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

name

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

nrLines

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

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

size

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

string [WRAP]

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

stripCFWS [STRING]

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

toDate [TIME]

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

toDisclose

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

toInt

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

unfoldedBody [BODY, [WRAP]]

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

wellformedName [STRING]

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

Reading and Writing [internals]

consume LINE | (NAME,BODY|OBJECTS)

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

consumeComment STRING

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

consumeDotAtom STRING

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

consumePhrase STRING

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

decode STRING, OPTIONS

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

defaultWrapLength [LENGTH]

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

encode STRING, OPTIONS

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

fold NAME, BODY, [MAXCHARS]

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

setWrapLength [LENGTH]

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

unfold STRING

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

Logging and Tracing

defaultTrace [LEVEL, [LEVEL]

See Mail::Reporter::defaultTrace()

errors

See Mail::Reporter::errors()

log [LEVEL [,STRINGS]]

See Mail::Reporter::log()

report [LEVEL]

See Mail::Reporter::report()

reportAll [LEVEL]

See Mail::Reporter::reportAll()

trace [LEVEL]

See Mail::Reporter::trace()

warnings

See Mail::Reporter::warnings()

Other Methods

AUTOLOAD

See Mail::Reporter::AUTOLOAD()

DESTROY

See Mail::Reporter::DESTROY()

inGlobalDestruction

See Mail::Reporter::inGlobalDestruction()

logPriority LEVEL

See Mail::Reporter::logPriority()

logSettings

See Mail::Reporter::logSettings()

notImplemented

See Mail::Reporter::notImplemented()

SEE ALSO

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

AUTHOR

Written by Mark Overmeer (mark@overmeer.net) with the help of many. See the ChangeLog for details.

VERSION

This code is beta, version 2.040.

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.