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::Box::Maildir::Message - one message in a Maildir folder

INHERITANCE

 Mail::Box::Maildir::Message
   is a Mail::Box::Dir::Message
   is a Mail::Box::Message
   is a Mail::Message
   is a Mail::Reporter

SYNOPSIS

 my $folder = new Mail::Box::Maildir ...
 my $message = $folder->message(10);

DESCRIPTION

A Mail::Box::Maildir::Message represents one message in an Mail::Box::Maildir folder. Each message is stored in a separate file.

METHODS

Constructors

$obj->clone

Mail::Box::Maildir::Message->coerce(MESSAGE)

Mail::Box::Maildir::Message->new(OPTIONS)

Constructing a message

$obj->bounce([RG-OBJECT|OPTIONS])

Mail::Box::Maildir::Message->build([MESSAGE|BODY], CONTENT)

Mail::Box::Maildir::Message->buildFromBody(BODY, [HEAD], HEADERS)

$obj->forward(OPTIONS)

$obj->forwardPostlude

$obj->forwardPrelude

$obj->forwardSubject(STRING)

Mail::Box::Maildir::Message->read(FILEHANDLE|SCALAR|REF-SCALAR|ARRAY-OF-LINES, OPTIONS)

$obj->rebuild(OPTIONS)

$obj->reply(OPTIONS)

$obj->replyPrelude([STRING|FIELD|ADDRESS])

$obj->replySubject(STRING)

Mail::Box::Maildir::Message->replySubject(STRING)

The Message

$obj->container

$obj->copyTo(FOLDER)

$obj->filename([FILENAME])

    Returns the current filename for this message. If the FILENAME argument is specified, a new filename will be set. For maildir messages this means that modifications are immediately performed: there will be a rename (move) from the old name to the new name. Labels may change within in the message object as well.

$obj->folder([FOLDER])

$obj->isDummy

$obj->isPart

$obj->messageId

$obj->moveTo(FOLDER)

$obj->print([FILEHANDLE])

$obj->send([MAILER], OPTIONS)

$obj->seqnr([INTEGER])

$obj->size

$obj->toplevel

$obj->write([FILEHANDLE])

The header

$obj->bcc

$obj->cc

$obj->date

$obj->destinations

$obj->from

$obj->get(FIELD)

$obj->guessTimestamp

    The filename of a Mail::Box::Maildir::Message contains a timestamp. This is a wild guess about the actual time of sending of the message: it is the time of receipt which may be seconds to hours off. But is still a good guess... When the message header is not parsed, then this date is used.

$obj->head([HEAD])

$obj->nrLines

$obj->sender

$obj->subject

$obj->timestamp

$obj->to

The body

$obj->body([BODY])

$obj->decoded(OPTIONS)

$obj->encode(OPTIONS)

$obj->isMultipart

$obj->isNested

$obj->parts(['ALL'|'ACTIVE'|'DELETED'|'RECURSE'|FILTER])

Flags

$obj->delete

$obj->deleted([BOOLEAN])

$obj->isDeleted

$obj->isModified

$obj->label(LABEL [,VALUE [LABEL, VALUE] ])

$obj->labels

$obj->labelsToStatus

$obj->modified([BOOLEAN])

$obj->statusToLabels

The whole message as text

$obj->file

$obj->lines

$obj->printStructure([FILEHANDLE][, INDENT])

$obj->string

Internals

$obj->accept

    Accept a message for the folder. This will move it from the new or tmp sub-directories into the cur sub-directory. When you accept an already accepted message, nothing will happen.

$obj->create(FILENAME)

$obj->diskDelete

$obj->isDelayed

$obj->labelsToFilename

    When the labels on a message change, this may implicate a change in the message's filename. The change will take place immediately.

$obj->loadBody

$obj->loadHead

$obj->parser

$obj->readBody(PARSER, HEAD [, BODYTYPE])

$obj->readFromParser(PARSER, [BODYTYPE])

$obj->readHead(PARSER [,CLASS])

$obj->recursiveRebuildPart(PART, OPTIONS)

$obj->storeBody(BODY)

$obj->takeMessageId([STRING])

Error handling

$obj->AUTOLOAD

$obj->defaultTrace([LEVEL, [LEVEL])

Mail::Box::Maildir::Message->defaultTrace([LEVEL, [LEVEL])

$obj->errors

$obj->log([LEVEL [,STRINGS]])

Mail::Box::Maildir::Message->log([LEVEL [,STRINGS]])

$obj->logPriority(LEVEL)

Mail::Box::Maildir::Message->logPriority(LEVEL)

$obj->logSettings

$obj->notImplemented

$obj->report([LEVEL])

$obj->reportAll([LEVEL])

$obj->shortString

$obj->trace([LEVEL])

$obj->warnings

Cleanup

$obj->DESTROY

$obj->inGlobalDestruction

DIAGNOSTICS

Error: Cannot create parser for $filename.

For some reason (the previous message have told you already) it was not possible to create a message parser for the specified filename.

Error: Cannot include forward source as $include.

Unknown alternative for the forward(include). Valid choices are NO, INLINE, and ATTACH.

Error: Cannot include reply source as $include.

Unknown alternative for the include option of reply(). Valid choices are NO, INLINE, and ATTACH.

Error: Cannot write message to $filename: $!

When a modified or new message is written to disk, it is first written to a temporary file in the folder directory. For some reason, it is impossible to create this file.

Error: Failed to move $new to $filename: $!

When a modified or new message is written to disk, it is first written to a temporary file in the folder directory. Then, the new file is moved to replace the existing file. Apparently, the latter fails.

Error: Message $filename is not in a Maildir folder.

To accept a message into a folder (move it from a temporary location into this folder's view), it must be already created one maildir folder's sub-directory. When a foreign message is coerce to become part of a maildir, the coercion will create a file which is acceptable.

Error: No address to create forwarded to.

If a forward message is created, a destination address must be specified.

Error: No default mailer found to send message.

The message send() mechanism had not enough information to automatically find a mail transfer agent to sent this message. Specify a mailer explicitly using the via options.

Error: Package $package does not implement $method.

Fatal error: the specific package (or one of its superclasses) does not implement this method where it should. This message means that some other related classes do implement this method however the class at hand does not. Probably you should investigate this and probably inform the author of the package.

Error: Unable to read delayed body.

For some reason, the header of the message could be read, but the body cannot. Probably the file has disappeared or the permissions were changed during the progress of the program.

Error: Unable to read delayed head.

Mail::Box tries to be lazy with respect to parsing messages. When a directory organized folder is opened, only the filenames of messages are collected. At first use, the messages are read from their file. Apperently, a message is used for the first time here, but has disappeared or is unreadible for some other reason.

Error: no rebuild rule $name defined.

DETAILS

REFERENCES

See the Mail::Box website at http://perl.overmeer.net/mailbox/ for more details.

COPYRIGHTS

Module version 2.041. Written by Mark Overmeer (mark@overmeer.net). See the ChangeLog for other contributors.

Copyright (c) 2001-2003 by the author(s). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.