OVERLOADED

overload: ""
See "" in Mail::Message::Head.
overload: bool
See bool in Mail::Message::Head.

METHODS

See METHODS in Mail::Reporter

Constructors

$obj->build( [PAIR|FIELD]-LIST )
See build in Mail::Message::Head::Complete.
$obj->clone( [NAMES|ARRAY-OF-NAMES|REGEXS] )
See clone in Mail::Message::Head::Complete.
$class->new( [ARG], OPTIONS )

The ARG is an array with header lines.

Option Defined in Default

FoldLength

79

MailFrom

'KEEP'

Modify

<false>

field_type

Mail::Message::Head

Mail::Message::Field::Fast

log

Mail::Reporter

'WARNINGS'

message

Mail::Message::Head

undef

modified

Mail::Message::Head

<false>

trace

Mail::Reporter

'WARNINGS'

FoldLength => INTEGER
MailFrom => 'IGNORE'|'ERROR'|'COERCE'|'KEEP'
How to handle the From lines. See mail_from().
Modify => BOOLEAN
Reformat all header lines when they come in: change the folding.
field_type => CLASS
log => LEVEL
message => MESSAGE
modified => BOOLEAN
trace => LEVEL

The header

$obj->isDelayed
See isDelayed in Mail::Message::Head.
$obj->isEmpty
See isEmpty in Mail::Message::Head.
$obj->isModified
See isModified in Mail::Message::Head.
$obj->knownNames
See knownNames in Mail::Message::Head.
$obj->message( [MESSAGE] )
See message in Mail::Message::Head.
$obj->modified( [BOOLEAN] )
See modified in Mail::Message::Head.
$obj->nrLines
See nrLines in Mail::Message::Head::Complete.
$obj->orderedFields
See orderedFields in Mail::Message::Head.
$obj->size
See size in Mail::Message::Head::Complete.
$obj->wrap( INTEGER )
See wrap in Mail::Message::Head::Complete.

Access to the header

$obj->add( LINE, [INDEX] )

Add a header line, which simply calls Mail::Message::Head::add() on the header for the specified LINE. The INDEX is ignored, the unfolded body of the field is returned.

$obj->addListGroup( OBJECT )
See addListGroup in Mail::Message::Head::Complete.
$obj->addResentGroup( RESENT-GROUP|DATA )
See addResentGroup in Mail::Message::Head::Complete.
$obj->addSpamGroup( OBJECT )
See addSpamGroup in Mail::Message::Head::Complete.
$obj->count( NAME )
See count in Mail::Message::Head::Complete.
$obj->delete( TAG, [INDEX] )

Delete the fields with the specified TAG. The deleted fields are returned. If no index is given, then all are removed.

$obj->get( NAME, [INDEX] )

Get all the header fields with the specified NAME. In scalar context, only the first fitting NAME is returned. Even when only one NAME is specified, multiple lines may be returned in list context: some fields appear more than once in a header.

$obj->grepNames( [NAMES|ARRAY-OF-NAMES|REGEXS] )
See grepNames in Mail::Message::Head::Complete.
$obj->listGroup
See listGroup in Mail::Message::Head::Complete.
$obj->names
See names in Mail::Message::Head::Complete.
$obj->print( [FILEHANDLE] )
See print in Mail::Message::Head::Complete.
$obj->printSelected( FILEHANDLE, (STRING|REGEXP)s )
See printSelected in Mail::Message::Head::Complete.
$obj->printUndisclosed( [FILEHANDLE] )
See printUndisclosed in Mail::Message::Head::Complete.
$obj->removeContentInfo
See removeContentInfo in Mail::Message::Head::Complete.
$obj->removeField( FIELD )
See removeField in Mail::Message::Head::Complete.
$obj->removeFields( STRING|REGEXP, [STRING|REGEXP, ...] )
See removeFields in Mail::Message::Head::Complete.
$obj->removeFieldsExcept( STRING|REGEXP, [STRING|REGEXP, ...] )
See removeFieldsExcept in Mail::Message::Head::Complete.
$obj->removeListGroup
See removeListGroup in Mail::Message::Head::Complete.
$obj->removeResentGroups
See removeResentGroups in Mail::Message::Head::Complete.
$obj->removeSpamGroups
See removeSpamGroups in Mail::Message::Head::Complete.
$obj->replace( TAG, LINE, [INDEX] )

Replace the field named TAG. from place INDEX (by default the first) by the LINE. When TAG is undef, it will be extracted from the LINE first. This calls Mail::Message::Head::Complete::reset() on the message's head.

$obj->resentGroups
See resentGroups in Mail::Message::Head::Complete.
$obj->reset( NAME, FIELDS )
See reset in Mail::Message::Head::Complete.
$obj->set( FIELD | LINE | (NAME, BODY [,ATTRS]) )
See set in Mail::Message::Head::Complete.
$obj->spamDetected
See spamDetected in Mail::Message::Head::Complete.
$obj->spamGroups( [NAMES] )
See spamGroups in Mail::Message::Head::Complete.
$obj->string
See string in Mail::Message::Head::Complete.
$obj->study( NAME [,INDEX] )
See study in Mail::Message::Head.

About the body

$obj->guessBodySize
See guessBodySize in Mail::Message::Head.
$obj->guessTimeStamp
See guessTimeStamp in Mail::Message::Head::Complete.
$obj->isMultipart
See isMultipart in Mail::Message::Head.
$obj->recvstamp
See recvstamp in Mail::Message::Head::Complete.
$obj->timestamp
See timestamp in Mail::Message::Head::Complete.

Internals

$obj->addNoRealize( FIELD )
See addNoRealize in Mail::Message::Head.
$obj->addOrderedFields( FIELDS )
See addOrderedFields in Mail::Message::Head.
$obj->createFromLine
See createFromLine in Mail::Message::Head::Complete.
$obj->createMessageId
See createMessageId in Mail::Message::Head::Complete.
$obj->fileLocation
See fileLocation in Mail::Message::Head.
$obj->load
See load in Mail::Message::Head.
$obj->messageIdPrefix( [PREFIX, [HOSTNAME]|CODE] )
$class->messageIdPrefix( [PREFIX, [HOSTNAME]|CODE] )
See messageIdPrefix in Mail::Message::Head::Complete.
$obj->moveLocation( DISTANCE )
See moveLocation in Mail::Message::Head.
$obj->setNoRealize( FIELD )
See setNoRealize in Mail::Message::Head.

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.

Access to the header

Simulating Mail::Header

$obj->as_string

Returns the whole header as one big scalar. Calls Mail::Message::Head::Complete::string().

$obj->cleanup

Cleanup memory usage. Not needed here.

$obj->combine( TAG, [WITH] )

I do not see any valid reason for this command, so did not implement it.

$obj->dup

Duplicate the header, which is simply clone().

$obj->empty

Clean-out the whole hash. Better not use this (simply create another header object), although it should work.

$obj->exists

Returns whether there are any fields.

$obj->extract( ARRAY )

Extract (and remove) header fields from the array.

$obj->fold( [LENGTH] )

Refold all fields in the header, to LENGTH or whatever fold_length() returns.

$obj->fold_length( [[TAG], LENGTH] )

Returns the line wrap, optionally after setting it to LENGTH. The old value is returned. The TAG argument is ignored, because it is silly to have different lines fold in different ways. This method cannot be called statically anymore.

$obj->header_hashref( HASH )

If you are using this method, you must be stupid... anyway: I do not want to support it for now: use add() and friends.

$obj->mail_from( ['IGNORE'|'ERROR'|'COERCE'|'KEEP'] )

What to do when a header line in the form `From ' is encountered. Valid values are IGNORE - ignore and discard the header, ERROR - invoke an error (call die), COERCE - rename them as Mail-From and KEEP - keep them.

$obj->modify( [BOOLEAN] )

Refold the headers when they are added.

$obj->read( FILE )

Read the header from the FILE.

$obj->tags

Returns all the names of fields, implemented by Mail::Message::Head::Complete::names().

$obj->unfold( [TAG] )

Remove the folding for all instances of TAG, or all fields at once.

The nasty bits

$obj->isa( CLASS )
$class->isa( CLASS )

Of course, the isa() class inheritance check should not see our nasty trick.