METHODS

See METHODS in Mail::Reporter

Constructors

$obj->clone( %options )
See clone in Mail::Message.
$class->new( %options )
Option Defined in Default

body

Mail::Message

undef

body_type

<from folder>

deleted

Mail::Message

<false>

field_type

Mail::Message

undef

folder

<required>

head

Mail::Message

undef

head_type

Mail::Message

Mail::Message::Head::Complete

labels

Mail::Message

{}

log

Mail::Reporter

'WARNINGS'

messageId

Mail::Message

undef

modified

Mail::Message

<false>

size

undef

trace

Mail::Reporter

'WARNINGS'

trusted

Mail::Message

<false>

body => OBJECT
body_type => CODE|CLASS
If the body of a message is used delay-loaded, the message must what type of message to become when it finally gets parsed. The folder which is delaying the load must specify the algorithm to determine that type.
deleted => BOOLEAN
field_type => CLASS
folder => FOLDER
The folder where this message appeared in. The argument is an instance of (a sub-class of) a Mail::Box.
head => OBJECT
head_type => CLASS
labels => ARRAY|HASH
log => LEVEL
messageId => STRING
modified => BOOLEAN
size => INTEGER
The size of the message, which includes head and body, but without the message separators which may be used by the folder type.
trace => LEVEL
trusted => BOOLEAN

Constructing a message

$obj->bounce( [<$rg_object|%options>] )
See bounce in Mail::Message::Construct::Bounce.
$class->build( [$message|$part|$body], $content )
See build in Mail::Message::Construct::Build.
$class->buildFromBody( $body, [$head], $headers )
See buildFromBody in Mail::Message::Construct::Build.
$obj->forward( %options )
See forward in Mail::Message::Construct::Forward.
$obj->forwardAttach( %options )
See forwardAttach in Mail::Message::Construct::Forward.
$obj->forwardEncapsulate( %options )
See forwardEncapsulate in Mail::Message::Construct::Forward.
$obj->forwardInline( %options )
See forwardInline in Mail::Message::Construct::Forward.
$obj->forwardNo( %options )
See forwardNo in Mail::Message::Construct::Forward.
$obj->forwardPostlude
See forwardPostlude in Mail::Message::Construct::Forward.
$obj->forwardPrelude
See forwardPrelude in Mail::Message::Construct::Forward.
$obj->forwardSubject( STRING )
See forwardSubject in Mail::Message::Construct::Forward.
$class->read( $fh|STRING|SCALAR|ARRAY, %options )
See read in Mail::Message::Construct::Read.
$obj->rebuild( %options )
See rebuild in Mail::Message::Construct::Rebuild.
$obj->reply( %options )
See reply in Mail::Message::Construct::Reply.
$obj->replyPrelude( [STRING|$field|$address|ARRAY-$of-$things] )
See replyPrelude in Mail::Message::Construct::Reply.
$obj->replySubject( STRING )
$class->replySubject( STRING )
See replySubject in Mail::Message::Construct::Reply.

The message

$obj->container
See container in Mail::Message.
$obj->copyTo( $folder, %options )

Copy the message to the indicated opened $folder, without deleting the original. The coerced message (the clone in the destination folder) is returned.

Option Default

shallow

<false>

shallow_body

<false>

shallow_head

<false>

share

<false>

shallow => BOOLEAN
Used for clone(shallow).
shallow_body => BOOLEAN
Used for clone(shallow_body).
shallow_head => BOOLEAN
Used for clone(shallow_head).
share => BOOLEAN
Try to share the physical storage of the message between the two folders. Sometimes, they even may be of different types. When not possible, this options will be silently ignored.
» Example:
 my $draft = $mgr->open(folder => 'Draft');
 $message->copyTo($draft, share => 1);
$obj->folder( [$folder] )

In with folder did we detect this message/dummy? This is a reference to the folder-object.

$obj->isDummy
See isDummy in Mail::Message.
$obj->isPart
See isPart in Mail::Message.
$obj->messageId
See messageId in Mail::Message.
$obj->moveTo( $folder, %options )

Move the message from this folder to the $folder specified. This will create a copy using clone() first. Then, this original message is flagged to get deleted. So until the source folder is closed, two copies of the message may stay in memory.

The newly created message clone (part of the destination folder) is returned. All %options are passed to copyTo()

Option Default

shallow_body

<undef>

share

<true unless shallow_body exists>

shallow_body => BOOLEAN
Only create a shallow body, which means that the header can not be reused. A message can therefore not be shared in storage unless explicitly stated.
share => BOOLEAN
When there is a chance that the original message can be undeleted, then this must be set to false. Otherwise a shallow clone will be made, which will share the header which can be modified in the undeleted message.
» Example: of moving a message
 my $trash = Mail::Box::Mbox->new(folder => 'trash');
 my $t = $msg->moveTo($trash);

is equivalent to

 my $t = $msg->copyTo($trash, share => 1);
 $msg->delete;
$obj->partNumber
See partNumber in Mail::Message.
$obj->print( [$fh] )
See print in Mail::Message.
$obj->send( [$mailer], %options )
See send in Mail::Message.
$obj->seqnr( [$integer] )

Get the number of this message is the current folder. It starts counting from zero. Do not change the number.

$obj->size
See size in Mail::Message.
$obj->toplevel
See toplevel in Mail::Message.
$obj->write( [$fh] )
See write in Mail::Message.

The header

$obj->bcc
See bcc in Mail::Message.
$obj->cc
See cc in Mail::Message.
$obj->date
See date in Mail::Message.
$obj->destinations
See destinations in Mail::Message.
$obj->from
See from in Mail::Message.
$obj->get( $fieldname )
See get in Mail::Message.
$obj->guessTimestamp
See guessTimestamp in Mail::Message.
$obj->nrLines
See nrLines in Mail::Message.
$obj->sender
See sender in Mail::Message.
$obj->study( $fieldname )
See study in Mail::Message.
$obj->subject
See subject in Mail::Message.
$obj->timestamp
See timestamp in Mail::Message.
$obj->to
See to in Mail::Message.

The body

$obj->body( [$body] )
See body in Mail::Message.
$obj->contentType
See contentType in Mail::Message.
$obj->decoded( %options )
See decoded in Mail::Message.
$obj->encode( %options )
See encode in Mail::Message.
$obj->isMultipart
See isMultipart in Mail::Message.
$obj->isNested
See isNested in Mail::Message.
$obj->parts( [<'ALL'|'ACTIVE'|'DELETED'|'RECURSE'|$filter>] )
See parts in Mail::Message.

Flags

$obj->delete
See delete in Mail::Message.
$obj->deleted( [BOOLEAN] )
See deleted in Mail::Message.
$obj->isDeleted
See isDeleted in Mail::Message.
$obj->isModified
See isModified in Mail::Message.
$obj->label( $label|PAIRS )
See label in Mail::Message.
$obj->labels
See labels in Mail::Message.
$obj->labelsToStatus
See labelsToStatus in Mail::Message.
$obj->modified( [BOOLEAN] )
See modified in Mail::Message.
$obj->statusToLabels
See statusToLabels in Mail::Message.

The whole message as text

$obj->file
See file in Mail::Message::Construct::Text.
$obj->lines
See lines in Mail::Message::Construct::Text.
$obj->printStructure( [$fh|undef],[$indent] )
See printStructure in Mail::Message::Construct::Text.
$obj->string
See string in Mail::Message::Construct::Text.

Internals

$obj->clonedFrom
See clonedFrom in Mail::Message.
$class->coerce( $message, %options )
See coerce in Mail::Message.
$obj->diskDelete

Remove a message from disk. This is not from the folder, but everything else, like parts of the message which are stored outside from the folder.

$obj->isDelayed
See isDelayed in Mail::Message.
$obj->readBody( $parser, $head, [$bodytype] )

Read the body of one message. The $parser gives access to the folder file. The $head has been read with readHead(). The optional $bodytype supplies the class name of the body to be created, or a code reference to a routine which can produce a body type based on the head (passed as first argument).

By default, the $bodytype will call Mail::Box::determineBodyType() where the message will be added to.

$obj->readFromParser( $parser, [$bodytype] )
See readFromParser in Mail::Message.
$obj->readHead( $parser, [$class] )
See readHead in Mail::Message.
$obj->recursiveRebuildPart( $part, %options )
See recursiveRebuildPart in Mail::Message::Construct::Rebuild.
$obj->storeBody( $body )
See storeBody in Mail::Message.
$obj->takeMessageId( [STRING] )
See takeMessageId in Mail::Message.

Error handling

$obj->AUTOLOAD
See AUTOLOAD in Mail::Message::Construct.
$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->shortSize( [$value] )
$class->shortSize( [$value] )
See shortSize in Mail::Message.
$obj->shortString
See shortString in Mail::Message.
$obj->trace( [$level] )
See trace in Mail::Reporter.
$obj->warnings
See warnings in Mail::Reporter.

Cleanup

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

Removes most of the memory occupied by the message by detaching the header and body. Then, the object changes into a Mail::Box::Message::Destructed which will catch all attempts to access the header and body. Be careful with the usage of this method.