{
    "mode": "info",
    "parameter": "Mail::Box::Identity",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/Mail%3A%3ABox%3A%3AIdentity/json",
    "generated": "2026-07-05T13:47:16Z",
    "synopsis": "use User::Identity;\nuse Mail::Box::Identity;\nmy $me   = User::Identity->new(...);\nmy $mailbox = Mail::Box::Identity->new(...);\n$me->add(folders => $mailbox);\n# Simpler\nuse User::Identity;\nmy $me   = User::Identity->new(...);\nmy $addr = $me->add(folders => ...);",
    "sections": {
        "Mail::Box::Identity(3pUser Contributed Perl DocumentatMail::Box::Identity(3pm)": {
            "content": "",
            "subsections": []
        },
        "NAME": {
            "content": "Mail::Box::Identity - represents an unopened folder\n",
            "subsections": []
        },
        "INHERITANCE": {
            "content": "Mail::Box::Identity\nis an User::Identity::Item\n\nMail::Box::Identity\nis a Mail::Reporter\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use User::Identity;\nuse Mail::Box::Identity;\nmy $me   = User::Identity->new(...);\n\nmy $mailbox = Mail::Box::Identity->new(...);\n$me->add(folders => $mailbox);\n\n# Simpler\n\nuse User::Identity;\nmy $me   = User::Identity->new(...);\nmy $addr = $me->add(folders => ...);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The \"Mail::Box::Identity\" object contains the description of a single\nmailbox.  The mailboxes are collected by an Mail::Box::Collection\nobject.  This corresponds with IMAP's \"\\NoSelect\", for instance.\n\nNearly all methods can return undef.\n\nExtends \"DESCRIPTION\" in Mail::Reporter.\n\nExtends \"DESCRIPTION\" in User::Identity::Item.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "Extends \"METHODS\" in Mail::Reporter.\n\nExtends \"METHODS\" in User::Identity::Item.\n\nConstructors\nExtends \"Constructors\" in Mail::Reporter.\n\nExtends \"Constructors\" in User::Identity::Item.\n\nMail::Box::Identity->new( [$name], %options )\n-Option     --Defined in          --Default\ndeleted                            <false>\ndescription  User::Identity::Item  undef\nfoldertype                        from parent\ninferiors                          1\nlocation                           undef\nlog          Mail::Reporter        'WARNINGS'\nmanager                            <from parent>\nmarked                             undef\nname         User::Identity::Item  <required>\nonlysubs                          <foldertype and name dependent>\nparent       User::Identity::Item  undef\nsubftype                          <same as parent>\ntrace        Mail::Reporter        'WARNINGS'\n\ndeleted => BOOLEAN\nThe folder is flagged for deletion.  This not have any\nimplications yet, because it may still get undeleted.\n\ndescription => STRING\nfoldertype => CLASS\ninferiors => BOOLEAN\nCan this folder have children?  If not, this is cleared.\n\nlocation => DIRECTORY|FILENAME\nThe location of this folder.  Often, only the manager can figure-\nout where this folder really is.\n\nlog => LEVEL\nmanager => OBJECT\nAny Mail::Box::Manager or Mail::Box::Manage::User OBJECT.\n\nmarked => BOOLEAN|\"undef\"\nWhether the folder is flagged for some reason, for instance\nbecause new messages have arrived.\n\nname => STRING\nonlysubs => BOOLEAN\nSome folder types can have messages in their toplevel folder,\nother cannot. That determines the default.  See\nMail::Box::topFolderWithMessages()\n\nparent => OBJECT\nsubftype => CLASS\nThe type for a subfolder collection, must extend CLASS\nMail::Box::Collection.\n\ntrace => LEVEL\n\nAttributes\nExtends \"Attributes\" in User::Identity::Item.\n\n$obj->deleted( [BOOLEAN] )\n$obj->description()\nInherited, see \"Attributes\" in User::Identity::Item\n\n$obj->folderType()\nReturns the type of this folder.\n\n$obj->fullname( [$delimeter] )\nReturns the name of the folder, from the toplevel until this one,\nwith the $delimeter string between each level.  $delimeter default\nto a forward slash (a \"/\").\n\n$obj->inferiors( [BOOLEAN] )\n\"Inferiors\" are \"subfolders\".  When this flag is set, it is\npermitted to create subfolders.\n\n$obj->location( [$filename|$directory|undef] )\nReturns the directory or filename of the folder.  If this is not\npre-defined, it is computed based on the knowledge about the folder\ntype.  Be sure to set the location of the toplevel folder to the\nfolderdir of the user to get this to work.\n\n$obj->manager()\nReturns the manager (usually a Mail::Box::Manage::User which owns\nthe folders.  May be undefined, by default from parent.\n\n$obj->marked( [BOOLEAN|undef] )\nWhen something special has happened with the folder, this flag can\nbe set (or cleared).  The \"undef\" status is an \"unknown\".  In the\nIMAP4 protocol, 0 will result in a \"\\Unmarked\", a 1 results in a\n\"\\Marked\", and \"undef\" in nothing.\n\n$obj->name( [$newname] )\nInherited, see \"Attributes\" in User::Identity::Item\n\n$obj->onlySubfolders( [BOOLEAN] )\nThan this folder be opened (without trying) or not?  The default\ndepends on the folder type, and whether this is the toplevel folder\nor not.  See Mail::Box::topFolderWithMessages()\n\n$obj->topfolder()\nRun up the tree to find the highest level folder.\n\nCollections\nExtends \"Collections\" in User::Identity::Item.\n\n$obj->add($collection, $role)\nInherited, see \"Collections\" in User::Identity::Item\n\n$obj->addCollection( $object | <[$type], %options> )\nInherited, see \"Collections\" in User::Identity::Item\n\n$obj->collection($name)\nInherited, see \"Collections\" in User::Identity::Item\n\n$obj->parent( [$parent] )\nInherited, see \"Collections\" in User::Identity::Item\n\n$obj->removeCollection($object|$name)\nInherited, see \"Collections\" in User::Identity::Item\n\n$obj->type()\nMail::Box::Identity->type()\nInherited, see \"Collections\" in User::Identity::Item\n\n$obj->user()\nInherited, see \"Collections\" in User::Identity::Item\n\nSearching\nExtends \"Searching\" in User::Identity::Item.\n\n$obj->find($collection, $role)\nInherited, see \"Searching\" in User::Identity::Item\n\nSubfolders\n$obj->addSubfolder($m<Mail::Box::Identity>|$data)\nAdd a new folder into the administration.  With $data, a new object\nwill be instantiated first.  The identity is returned on success.\n\n$obj->folder( [..., $name] )\nReturns the subfolder's object with $name or \"undef\" if it does not\nexist.  When multiple NAMEs are added, those super folders are\ntraverst first.  Without any $name, the current object is returned\n\nexample: get some folder\n\nmy $a = $user->folders->folder('b', 'a');\n\nmy $name  = \"a:b:c\";\nmy $delim = \":\";\nmy $f = $user->folders->folder(split $delim, $name);\n\n$obj->foreach(CODE)\nFor each of the subfolders found below this point call CODE.  This\ncurrent folder is called first.  Be warned that you may find\nidentities with the deleted() flag on.\n\n$obj->open(%options)\nOpen the folder which is described by this identity.  Returned is\nsome Mail::Box.  The options are passed to\nMail::Box::Manager::open().\n\n$obj->remove( [$name] )\nRemove the folder (plus subfolders) with the $name.  Without $name,\nthis \"Mail::Box::Identity\" itself is removed.\n\nThe removed structure is returned, which is \"undef\" if not found.\nThis is only an administrative remove, you still need a\nMail::Box::Manager::delete().\n\n$obj->rename( $folder, [$newsubname] )\nMove the folder to a different super-$folder, under a NEW SUBfolder\nNAME.\n\nexample: renaming a folder\n\nmy $top = $user->topfolder;\nmy $new = $top->folder('xyz') or die;\nmy $f   = $top->folder('abc', 'def')->rename($new, '123');\n\nprint $f->name;      # 123\nprint $f->fullname;  # =/xyz/123\n\n$obj->subfolderNames()\nConvenience method: returns the names of the collected subfolders.\n\n$obj->subfolders()\nReturns the subfolders or \"undef\" if there are none.  This\ninformation is lazy evaluated and cached.  In LIST context, the\nfolder objects are returned (Mail::Box::Identity objects), in\nSCALAR context the collection, the Mail::Box::Collection.\n\nError handling\nExtends \"Error handling\" in Mail::Reporter.\n\n$obj->AUTOLOAD()\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->addReport($object)\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level,\n$callback] )\nMail::Box::Identity->defaultTrace( [$level]|[$loglevel,\n$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::Identity->log( [$level, [$strings]] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->logPriority($level)\nMail::Box::Identity->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->trace( [$level] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->warnings()\nInherited, see \"Error handling\" in Mail::Reporter\n\nCleanup\nExtends \"Cleanup\" in Mail::Reporter.\n\n$obj->DESTROY()\nInherited, see \"Cleanup\" in Mail::Reporter\n",
            "subsections": []
        },
        "DIAGNOSTICS": {
            "content": "Error: $object is not a collection.\nThe first argument is an object, but not of a class which extends\nUser::Identity::Collection.\n\nError: Cannot load collection module for $type ($class).\nEither the specified $type does not exist, or that module named\n$class returns compilation errors.  If the type as specified in the\nwarning is not the name of a package, you specified a nickname\nwhich was not defined.  Maybe you forgot the 'require' the package\nwhich defines the nickname.\n\nError: Creation of a collection via $class failed.\nThe $class did compile, but it was not possible to create an object\nof that class using the options you specified.\n\nError: Don't know what type of collection you want to add.\nIf you add a collection, it must either by a collection object or a\nlist of options which can be used to create a collection object.\nIn the latter case, the type of collection must be specified.\n\nError: It is not permitted to add subfolders to $name\nThe $m<inferiors()> flag prohibits the creation of subfolders to\nthis folder.\n\nWarning: No collection $name\nThe collection with $name does not exist and can not be created.\n\nError: Package $package does not implement $method.\nFatal error: the specific package (or one of its superclasses) does\nnot implement this method where it should. This message means that\nsome other related classes do implement this method however the\nclass at hand does not.  Probably you should investigate this and\nprobably inform the author of the package.\n\nError: The toplevel folder cannot be removed this way\nThe Mail::Box::Identity folder administration structure requires a\ntop directory.  That top is registered somewhere (for instance by a\nMail::Box::Manage::User).  If you need to remove the top, you have\nto look for a method of that object.\n\nError: Toplevel directory requires explicit folder type\nError: Toplevel directory requires explicit location\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "This module is part of Mail-Box distribution version 3.009, built on\nAugust 18, 2020. Website: http://perl.overmeer.net/CPAN/\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "Copyrights 2001-2020 by [Mark Overmeer]. For other contributors see\nChangeLog.\n\nThis program is free software; you can redistribute it and/or modify it\nunder the same terms as Perl itself.  See http://dev.perl.org/licenses/\n\nperl v5.30.3                      2020-08-20          Mail::Box::Identity(3pm)",
            "subsections": []
        }
    },
    "summary": "Mail::Box::Identity - represents an unopened folder",
    "flags": [],
    "examples": [],
    "see_also": []
}