{
    "content": [
        {
            "type": "text",
            "text": "# Mail::Box::Message (perldoc)\n\n## NAME\n\nMail::Box::Message - manage one message within a mail-folder\n\n## SYNOPSIS\n\n# Usually these message objects are created indirectly\nuse Mail::Box::Manager;\nmy $manager = Mail::Box::Manager->new;\nmy $folder  = $manager->open(folder => 'Mail/Drafts');\nmy $msg     = $folder->message(1);\n$msg->delete;\n$msg->size;   # and much more\n\n## DESCRIPTION\n\nThese pages do only describe methods which relate to folders. If you access the knowledge of a\nmessage, then read Mail::Message.\n\n## Sections\n\n- **NAME**\n- **INHERITANCE**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS** (10 subsections)\n- **DETAILS**\n- **DIAGNOSTICS**\n- **SEE ALSO**\n- **LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Mail::Box::Message",
        "section": "",
        "mode": "perldoc",
        "summary": "Mail::Box::Message - manage one message within a mail-folder",
        "synopsis": "# Usually these message objects are created indirectly\nuse Mail::Box::Manager;\nmy $manager = Mail::Box::Manager->new;\nmy $folder  = $manager->open(folder => 'Mail/Drafts');\nmy $msg     = $folder->message(1);\n$msg->delete;\n$msg->size;   # and much more",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "INHERITANCE",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 2,
                "subsections": [
                    {
                        "name": "Constructors",
                        "lines": 47
                    },
                    {
                        "name": "Constructing a message",
                        "lines": 51
                    },
                    {
                        "name": "The message",
                        "lines": 98
                    },
                    {
                        "name": "The header",
                        "lines": 44
                    },
                    {
                        "name": "The body",
                        "lines": 23
                    },
                    {
                        "name": "Flags",
                        "lines": 29
                    },
                    {
                        "name": "The whole message as text",
                        "lines": 14
                    },
                    {
                        "name": "Internals",
                        "lines": 39
                    },
                    {
                        "name": "Error handling",
                        "lines": 48
                    },
                    {
                        "name": "Cleanup",
                        "lines": 10
                    }
                ]
            },
            {
                "name": "DETAILS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DIAGNOSTICS",
                "lines": 39,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Mail::Box::Message - manage one message within a mail-folder\n",
                "subsections": []
            },
            "INHERITANCE": {
                "content": "Mail::Box::Message\nis a Mail::Message\nis a Mail::Reporter\n\nMail::Box::Message is extended by\nMail::Box::Dir::Message\nMail::Box::File::Message\nMail::Box::Message::Destructed\nMail::Box::Net::Message\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "# Usually these message objects are created indirectly\nuse Mail::Box::Manager;\nmy $manager = Mail::Box::Manager->new;\nmy $folder  = $manager->open(folder => 'Mail/Drafts');\nmy $msg     = $folder->message(1);\n$msg->delete;\n$msg->size;   # and much more\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "These pages do only describe methods which relate to folders. If you access the knowledge of a\nmessage, then read Mail::Message.\n\nDuring its life, a message will pass through certain stages. These stages were introduced to\nreduce the access-time to the folder. Changing from stage, the message's body and head objects\nmay change.\n\nExtends \"DESCRIPTION\" in Mail::Message.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "Extends \"METHODS\" in Mail::Message.\n",
                "subsections": [
                    {
                        "name": "Constructors",
                        "content": "Extends \"Constructors\" in Mail::Message.\n\n$obj->clone(%options)\nInherited, see \"Constructors\" in Mail::Message\n\nMail::Box::Message->new(%options)\n-Option    --Defined in     --Default\nbody        Mail::Message    undef\nbodytype                    <from folder>\ndeleted     Mail::Message    <false>\nfieldtype  Mail::Message    undef\nfolder                       <required>\nhead        Mail::Message    undef\nheadtype   Mail::Message    Mail::Message::Head::Complete\nlabels      Mail::Message    {}\nlog         Mail::Reporter   'WARNINGS'\nmessageId   Mail::Message    undef\nmodified    Mail::Message    <false>\nsize                         undef\ntrace       Mail::Reporter   'WARNINGS'\ntrusted     Mail::Message    <false>\n\nbody => OBJECT\nbodytype => CODE|CLASS\nIf the body of a message is used delay-loaded, the message must what type of message to\nbecome when it finally gets parsed. The folder which is delaying the load must specify the\nalgorithm to determine that type.\n\ndeleted => BOOLEAN\nfieldtype => CLASS\nfolder => FOLDER\nThe folder where this message appeared in. The argument is an instance of (a sub-class of)\na Mail::Box.\n\nhead => OBJECT\nheadtype => CLASS\nlabels => ARRAY|HASH\nlog => LEVEL\nmessageId => STRING\nmodified => BOOLEAN\nsize => INTEGER\nThe size of the message, which includes head and body, but without the message separators\nwhich may be used by the folder type.\n\ntrace => LEVEL\ntrusted => BOOLEAN\n"
                    },
                    {
                        "name": "Constructing a message",
                        "content": "Extends \"Constructing a message\" in Mail::Message.\n\n$obj->bounce( [<$rgobject|%options>] )\nInherited, see \"Constructing a message\" in Mail::Message::Construct::Bounce\n\nMail::Box::Message->build( [$message|$part|$body], $content )\nInherited, see \"Constructing a message\" in Mail::Message::Construct::Build\n\nMail::Box::Message->buildFromBody($body, [$head], $headers)\nInherited, see \"Constructing a message\" in Mail::Message::Construct::Build\n\n$obj->forward(%options)\nInherited, see \"Constructing a message\" in Mail::Message::Construct::Forward\n\n$obj->forwardAttach(%options)\nInherited, see \"Constructing a message\" in Mail::Message::Construct::Forward\n\n$obj->forwardEncapsulate(%options)\nInherited, see \"Constructing a message\" in Mail::Message::Construct::Forward\n\n$obj->forwardInline(%options)\nInherited, see \"Constructing a message\" in Mail::Message::Construct::Forward\n\n$obj->forwardNo(%options)\nInherited, see \"Constructing a message\" in Mail::Message::Construct::Forward\n\n$obj->forwardPostlude()\nInherited, see \"Constructing a message\" in Mail::Message::Construct::Forward\n\n$obj->forwardPrelude()\nInherited, see \"Constructing a message\" in Mail::Message::Construct::Forward\n\n$obj->forwardSubject(STRING)\nInherited, see \"Constructing a message\" in Mail::Message::Construct::Forward\n\nMail::Box::Message->read($fh|STRING|SCALAR|ARRAY, %options)\nInherited, see \"Constructing a message\" in Mail::Message::Construct::Read\n\n$obj->rebuild(%options)\nInherited, see \"Constructing a message\" in Mail::Message::Construct::Rebuild\n\n$obj->reply(%options)\nInherited, see \"Constructing a message\" in Mail::Message::Construct::Reply\n\n$obj->replyPrelude( [STRING|$field|$address|ARRAY-$of-$things] )\nInherited, see \"Constructing a message\" in Mail::Message::Construct::Reply\n\n$obj->replySubject(STRING)\nMail::Box::Message->replySubject(STRING)\nInherited, see \"Constructing a message\" in Mail::Message::Construct::Reply\n"
                    },
                    {
                        "name": "The message",
                        "content": "Extends \"The message\" in Mail::Message.\n\n$obj->container()\nInherited, see \"The message\" in Mail::Message\n\n$obj->copyTo($folder, %options)\nCopy the message to the indicated opened $folder, without deleting the original. The coerced\nmessage (the clone in the destination folder) is returned.\n\n-Option      --Default\nshallow       <false>\nshallowbody  <false>\nshallowhead  <false>\nshare         <false>\n\nshallow => BOOLEAN\nUsed for clone(shallow).\n\nshallowbody => BOOLEAN\nUsed for clone(shallowbody).\n\nshallowhead => BOOLEAN\nUsed for clone(shallowhead).\n\nshare => BOOLEAN\nTry to share the physical storage of the message between the two folders. Sometimes, they\neven may be of different types. When not possible, this options will be silently ignored.\n\nexample:\n\nmy $draft = $mgr->open(folder => 'Draft');\n$message->copyTo($draft, share => 1);\n\n$obj->folder( [$folder] )\nIn with folder did we detect this message/dummy? This is a reference to the folder-object.\n\n$obj->isDummy()\nInherited, see \"The message\" in Mail::Message\n\n$obj->isPart()\nInherited, see \"The message\" in Mail::Message\n\n$obj->messageId()\nInherited, see \"The message\" in Mail::Message\n\n$obj->moveTo($folder, %options)\nMove the message from this folder to the $folder specified. This will create a copy using\nclone() first. Then, this original message is flagged to get deleted. So until the source\nfolder is closed, two copies of the message may stay in memory.\n\nThe newly created message clone (part of the destination folder) is returned. All %options\nare passed to copyTo()\n\n-Option      --Default\nshallowbody  <undef>\nshare         <true unless shallowbody exists>\n\nshallowbody => BOOLEAN\nOnly create a shallow body, which means that the header can not be reused. A message can\ntherefore not be shared in storage unless explicitly stated.\n\nshare => BOOLEAN\nWhen there is a chance that the original message can be undeleted, then this must be set\nto false. Otherwise a shallow clone will be made, which will share the header which can be\nmodified in the undeleted message.\n\nexample: of moving a message\n\nmy $trash = Mail::Box::Mbox->new(folder => 'trash');\nmy $t = $msg->moveTo($trash);\n\nis equivalent to\n\nmy $t = $msg->copyTo($trash, share => 1);\n$msg->delete;\n\n$obj->partNumber()\nInherited, see \"The message\" in Mail::Message\n\n$obj->print( [$fh] )\nInherited, see \"The message\" in Mail::Message\n\n$obj->send( [$mailer], %options )\nInherited, see \"The message\" in Mail::Message\n\n$obj->seqnr( [$integer] )\nGet the number of this message is the current folder. It starts counting from zero. Do not\nchange the number.\n\n$obj->size()\nInherited, see \"The message\" in Mail::Message\n\n$obj->toplevel()\nInherited, see \"The message\" in Mail::Message\n\n$obj->write( [$fh] )\nInherited, see \"The message\" in Mail::Message\n"
                    },
                    {
                        "name": "The header",
                        "content": "Extends \"The header\" in Mail::Message.\n\n$obj->bcc()\nInherited, see \"The header\" in Mail::Message\n\n$obj->cc()\nInherited, see \"The header\" in Mail::Message\n\n$obj->date()\nInherited, see \"The header\" in Mail::Message\n\n$obj->destinations()\nInherited, see \"The header\" in Mail::Message\n\n$obj->from()\nInherited, see \"The header\" in Mail::Message\n\n$obj->get($fieldname)\nInherited, see \"The header\" in Mail::Message\n\n$obj->guessTimestamp()\nInherited, see \"The header\" in Mail::Message\n\n$obj->head( [$head] )\nInherited, see \"The header\" in Mail::Message\n\n$obj->nrLines()\nInherited, see \"The header\" in Mail::Message\n\n$obj->sender()\nInherited, see \"The header\" in Mail::Message\n\n$obj->study($fieldname)\nInherited, see \"The header\" in Mail::Message\n\n$obj->subject()\nInherited, see \"The header\" in Mail::Message\n\n$obj->timestamp()\nInherited, see \"The header\" in Mail::Message\n\n$obj->to()\nInherited, see \"The header\" in Mail::Message\n"
                    },
                    {
                        "name": "The body",
                        "content": "Extends \"The body\" in Mail::Message.\n\n$obj->body( [$body] )\nInherited, see \"The body\" in Mail::Message\n\n$obj->contentType()\nInherited, see \"The body\" in Mail::Message\n\n$obj->decoded(%options)\nInherited, see \"The body\" in Mail::Message\n\n$obj->encode(%options)\nInherited, see \"The body\" in Mail::Message\n\n$obj->isMultipart()\nInherited, see \"The body\" in Mail::Message\n\n$obj->isNested()\nInherited, see \"The body\" in Mail::Message\n\n$obj->parts( [<'ALL'|'ACTIVE'|'DELETED'|'RECURSE'|$filter>] )\nInherited, see \"The body\" in Mail::Message\n"
                    },
                    {
                        "name": "Flags",
                        "content": "Extends \"Flags\" in Mail::Message.\n\n$obj->delete()\nInherited, see \"Flags\" in Mail::Message\n\n$obj->deleted( [BOOLEAN] )\nInherited, see \"Flags\" in Mail::Message\n\n$obj->isDeleted()\nInherited, see \"Flags\" in Mail::Message\n\n$obj->isModified()\nInherited, see \"Flags\" in Mail::Message\n\n$obj->label($label|PAIRS)\nInherited, see \"Flags\" in Mail::Message\n\n$obj->labels()\nInherited, see \"Flags\" in Mail::Message\n\n$obj->labelsToStatus()\nInherited, see \"Flags\" in Mail::Message\n\n$obj->modified( [BOOLEAN] )\nInherited, see \"Flags\" in Mail::Message\n\n$obj->statusToLabels()\nInherited, see \"Flags\" in Mail::Message\n"
                    },
                    {
                        "name": "The whole message as text",
                        "content": "Extends \"The whole message as text\" in Mail::Message.\n\n$obj->file()\nInherited, see \"The whole message as text\" in Mail::Message::Construct::Text\n\n$obj->lines()\nInherited, see \"The whole message as text\" in Mail::Message::Construct::Text\n\n$obj->printStructure( [$fh|undef],[$indent] )\nInherited, see \"The whole message as text\" in Mail::Message::Construct::Text\n\n$obj->string()\nInherited, see \"The whole message as text\" in Mail::Message::Construct::Text\n"
                    },
                    {
                        "name": "Internals",
                        "content": "Extends \"Internals\" in Mail::Message.\n\n$obj->clonedFrom()\nInherited, see \"Internals\" in Mail::Message\n\nMail::Box::Message->coerce($message, %options)\nInherited, see \"Internals\" in Mail::Message\n\n$obj->diskDelete()\nRemove a message from disk. This is not from the folder, but everything else, like parts of\nthe message which are stored outside from the folder.\n\n$obj->isDelayed()\nInherited, see \"Internals\" in Mail::Message\n\n$obj->readBody( $parser, $head, [$bodytype] )\nRead the body of one message. The $parser gives access to the folder file. The $head has\nbeen read with readHead(). The optional $bodytype supplies the class name of the body to be\ncreated, or a code reference to a routine which can produce a body type based on the head\n(passed as first argument).\n\nBy default, the $bodytype will call Mail::Box::determineBodyType() where the message will be\nadded to.\n\n$obj->readFromParser( $parser, [$bodytype] )\nInherited, see \"Internals\" in Mail::Message\n\n$obj->readHead( $parser, [$class] )\nInherited, see \"Internals\" in Mail::Message\n\n$obj->recursiveRebuildPart($part, %options)\nInherited, see \"Internals\" in Mail::Message::Construct::Rebuild\n\n$obj->storeBody($body)\nInherited, see \"Internals\" in Mail::Message\n\n$obj->takeMessageId( [STRING] )\nInherited, see \"Internals\" in Mail::Message\n"
                    },
                    {
                        "name": "Error handling",
                        "content": "Extends \"Error handling\" in Mail::Message.\n\n$obj->AUTOLOAD()\nInherited, see \"METHODS\" in Mail::Message::Construct\n\n$obj->addReport($object)\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )\nMail::Box::Message->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->errors()\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->log( [$level, [$strings]] )\nMail::Box::Message->log( [$level, [$strings]] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->logPriority($level)\nMail::Box::Message->logPriority($level)\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->logSettings()\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->notImplemented()\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->report( [$level] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->reportAll( [$level] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->shortSize( [$value] )\nMail::Box::Message->shortSize( [$value] )\nInherited, see \"Error handling\" in Mail::Message\n\n$obj->shortString()\nInherited, see \"Error handling\" in Mail::Message\n\n$obj->trace( [$level] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->warnings()\nInherited, see \"Error handling\" in Mail::Reporter\n"
                    },
                    {
                        "name": "Cleanup",
                        "content": "Extends \"Cleanup\" in Mail::Message.\n\n$obj->DESTROY()\nInherited, see \"Cleanup\" in Mail::Reporter\n\n$obj->destruct()\nRemoves most of the memory occupied by the message by detaching the header and body. Then,\nthe object changes into a Mail::Box::Message::Destructed which will catch all attempts to\naccess the header and body. Be careful with the usage of this method.\n"
                    }
                ]
            },
            "DETAILS": {
                "content": "Extends \"DETAILS\" in Mail::Message.\n",
                "subsections": []
            },
            "DIAGNOSTICS": {
                "content": "Error: Cannot coerce a $class object into a $class object\nError: Cannot include forward source as $include.\nUnknown alternative for the forward(include). Valid choices are \"NO\", \"INLINE\", \"ATTACH\",\nand \"ENCAPSULATE\".\n\nError: Cannot include reply source as $include.\nUnknown alternative for the \"include\" option of reply(). Valid choices are \"NO\", \"INLINE\",\nand \"ATTACH\".\n\nError: Method bounce requires To, Cc, or Bcc\nThe message bounce() method forwards a received message off to someone else without\nmodification; you must specified it's new destination. If you have the urge not to specify\nany destination, you probably are looking for reply(). When you wish to modify the content,\nuse forward().\n\nError: Method forwardAttach requires a preamble\nError: Method forwardEncapsulate requires a preamble\nError: No address to create forwarded to.\nIf a forward message is created, a destination address must be specified.\n\nError: No default mailer found to send message.\nThe message send() mechanism had not enough information to automatically find a mail\ntransfer agent to sent this message. Specify a mailer explicitly using the \"via\" options.\n\nError: No rebuild rule $name defined.\nError: Only build() Mail::Message's; they are not in a folder yet\nYou may wish to construct a message to be stored in a some kind of folder, but you need to\ndo that in two steps. First, create a normal Mail::Message, and then add it to the folder.\nDuring this Mail::Box::addMessage() process, the message will get coerce()-d into the right\nmessage type, adding storage information and the like.\n\nError: Package $package does not implement $method.\nFatal error: the specific package (or one of its superclasses) does not implement this\nmethod where it should. This message means that some other related classes do implement this\nmethod however the class at hand does not. Probably you should investigate this and probably\ninform the author of the package.\n\nError: coercion starts with some object\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "This module is part of Mail-Box distribution version 3.009, built on August 18, 2020. Website:\nhttp://perl.overmeer.net/CPAN/\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "Copyrights 2001-2020 by [Mark Overmeer]. For other contributors see ChangeLog.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself. See http://dev.perl.org/licenses/\n",
                "subsections": []
            }
        }
    }
}