OVERLOADED

overload: ""
See "" in Mail::Message::Field.
overload: 0+
See 0+ in Mail::Message::Field.
overload: <=>
See <=> in Mail::Message::Field.
overload: bool
See bool in Mail::Message::Field.
overload: cmp
See cmp in Mail::Message::Field.
overload: stringification
See stringification in Mail::Message::Field::Full.

METHODS

See METHODS in Mail::Reporter

Constructors

$obj->clone
See clone in Mail::Message::Field.
$class->from( $field, %options )
See from in Mail::Message::Field::Full.
$class->new( $data )

  • new LINE
    Pass a LINE as it could be found in a file: a (possibly folded) line which is terminated by a new-line.

  • new NAME, BODY, OPTIONS
    A set of values which shape the line.

The NAME is a wellformed header name (you may use wellformedName()) to be sure about the casing. The BODY is a string, one object, or an ref-array of objects. In case of objects, they must fit to the constructor of the field: the types which are accepted may differ. The optional ATTRIBUTE list contains Mail::Message::Field::Attribute objects. Finally, there are some OPTIONS.

Option Defined in Default

attributes

[]

charset

Mail::Message::Field::Full

undef

datum

undef

encoding

Mail::Message::Field::Full

'q'

force

Mail::Message::Field::Full

false

language

Mail::Message::Field::Full

undef

log

Mail::Reporter

'WARNINGS'

trace

Mail::Reporter

'WARNINGS'

attributes => ATTRS
There are various ways to specify these attributes: pass a reference to an array which list of key-value pairs representing attributes, or reference to a hash containing these pairs, or an array with Mail::Message::Field::Attribute objects.
charset => STRING
datum => STRING
The method name body is very confusing, even in the RFC. In MailBox, for historical reasons, body() returns the part of the field contents before the first semi-colon. foldedBody() and unfoldedBody() address the whole field.
There is no common name for the piece of data before the parameters (attributes) in the field-content mentioned in the RFCs, so let's call it datum.
encoding => 'q'|'Q'|'b'|'B'
force => BOOLEAN
language => STRING
log => LEVEL
trace => LEVEL
» Example: of a structured field
 my @attrs   = (Mail::Message::Field::Attribute->new(...), ...);
 my @options = (extra => 'the color blue');
 my $t = Mail::Message::Field::Full->new(To => \@addrs, @attrs, @options);

The field

$obj->isStructured
$class->isStructured
See isStructured in Mail::Message::Field.
$obj->length
See length in Mail::Message::Field.
$obj->nrLines
See nrLines in Mail::Message::Field.
$obj->print( [$fh] )
See print in Mail::Message::Field.
$obj->size
See size in Mail::Message::Field.
$obj->string( [$wrap] )
See string in Mail::Message::Field.
$obj->toDisclose
See toDisclose in Mail::Message::Field.

Access to the name

$obj->Name
See Name in Mail::Message::Field.
$obj->name
See name in Mail::Message::Field.
$obj->wellformedName( [STRING] )
See wellformedName in Mail::Message::Field.

Access to the body

$obj->body
See body in Mail::Message::Field.
$obj->decodedBody( %options )
See decodedBody in Mail::Message::Field::Full.
$obj->folded
See folded in Mail::Message::Field.
$obj->foldedBody( [$body] )
See foldedBody in Mail::Message::Field.
$obj->stripCFWS( [STRING] )
$class->stripCFWS( [STRING] )
See stripCFWS in Mail::Message::Field.
$obj->unfoldedBody( [$body, [$wrap]] )
See unfoldedBody in Mail::Message::Field.

Access to the content

$obj->addresses
See addresses in Mail::Message::Field.
$obj->attrPairs

Returns a list with attribute name and value pairs.

$obj->attribute( $object|<STRING, %options>|<$name,$value,%options> )

Add an attribute to the field. The attributes are added left-to-right into the string representation of the field, although the order of the attributes is un-important, according to the RFCs.

You may pass a fully prepared Mail::Message::Field::Attribute $object, if you like to do all preparations for correct representation of the data yourself. You may also pass one STRING, which is a fully prepared attribute. This STRING will not be changed, so be careful about quoting and encodings.

As third possibility, you can specify an attribute $name and its $value. An attribute object will be created for you implicitly in both cases where such object is not supplied, passing the %options. See Mail::Message::Field::Attribute::new() about the available %options.

The attribute object is returned, however, when continuations are used this may be an object you already know about. undef is returned when construction fails (when the attribute is incorrect).

» Example:
 $f->attribute(filename => 'passwd');
 $f->attribute(filename => 'passwd', use_continuations => 0);

 my $attr = Mail::Message::Field::Attribute->new(...);
 $f->attribute($attr);
$obj->attributes

Returns a list with all attributes, which are all Mail::Message::Field::Attribute objects. The attributes are not ordered in any way. The list may be empty. Double attributes or continuations are folded into one.

$obj->beautify
See beautify in Mail::Message::Field::Full.
$obj->comment( [STRING] )
See comment in Mail::Message::Field.
$obj->createComment( STRING, %options )
$class->createComment( STRING, %options )
See createComment in Mail::Message::Field::Full.
$obj->createPhrase( STRING, %options )
$class->createPhrase( STRING, %options )
See createPhrase in Mail::Message::Field::Full.
$obj->study
See study in Mail::Message::Field.
$obj->toDate( [$time] )
$class->toDate( [$time] )
See toDate in Mail::Message::Field.
$obj->toInt
See toInt in Mail::Message::Field.

Other methods

$obj->dateToTimestamp( STRING )
$class->dateToTimestamp( STRING )
See dateToTimestamp in Mail::Message::Field.

Internals

$obj->consume( $line | <$name,<$body|$objects>> )
See consume in Mail::Message::Field.
$obj->decode( STRING, %options )
$class->decode( STRING, %options )
See decode in Mail::Message::Field::Full.
$obj->defaultWrapLength( [$length] )
See defaultWrapLength in Mail::Message::Field.
$obj->encode( STRING, %options )
See encode in Mail::Message::Field::Full.
$obj->fold( $name, $body, [$maxchars] )
$class->fold( $name, $body, [$maxchars] )
See fold in Mail::Message::Field.
$obj->setWrapLength( [$length] )
See setWrapLength in Mail::Message::Field.
$obj->stringifyData( STRING|ARRAY|$objects )
See stringifyData in Mail::Message::Field.
$obj->unfold( STRING )
See unfold in Mail::Message::Field.

Parsing

$obj->consumeComment( STRING )
$class->consumeComment( STRING )
See consumeComment in Mail::Message::Field::Full.
$obj->consumeDotAtom( STRING )
See consumeDotAtom in Mail::Message::Field::Full.
$obj->consumePhrase( STRING )
$class->consumePhrase( STRING )
See consumePhrase in Mail::Message::Field::Full.
$obj->datum( [$value] )

The part of the field before the semi-colon (;).

$obj->parse( STRING )
See parse in Mail::Message::Field::Full.
$obj->produceBody
See produceBody in Mail::Message::Field::Full.

Error handling

$obj->AUTOLOAD
See AUTOLOAD in Mail::Reporter.
$obj->addReport( $object )
See addReport in Mail::Reporter.
$obj->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )
$class->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )
See defaultTrace in Mail::Reporter.
$obj->errors
See errors in Mail::Reporter.
$obj->log( [$level, [$strings]] )
$class->log( [$level, [$strings]] )
See log in Mail::Reporter.
$obj->logPriority( $level )
$class->logPriority( $level )
See logPriority in Mail::Reporter.
$obj->logSettings
See logSettings in Mail::Reporter.
$obj->notImplemented
See notImplemented in Mail::Reporter.
$obj->report( [$level] )
See report in Mail::Reporter.
$obj->reportAll( [$level] )
See reportAll in Mail::Reporter.
$obj->trace( [$level] )
See trace in Mail::Reporter.
$obj->warnings
See warnings in Mail::Reporter.

Cleanup

$obj->DESTROY
See DESTROY in Mail::Reporter.