{
    "mode": "perldoc",
    "parameter": "Mail::Box::Manage::User",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ABox%3A%3AManage%3A%3AUser/json",
    "generated": "2026-10-09T12:18:59Z",
    "synopsis": "use Mail::Box::Manage::User;\nuse User::Identity;\nmy $id      = User::Identity->new(...);\nmy $user    = Mail::Box::Manage::User->new\n( identity  => $id\n, folderdir => \"$ENV{HOME}/Mail\"\n, inbox     => $ENV{MAIL}\n);\nmy $inbox   = $user->open($user->inbox);\nmy $top     = $user->topfolder;",
    "sections": {
        "NAME": {
            "content": "Mail::Box::Manage::User - manage the folders of a user\n",
            "subsections": []
        },
        "INHERITANCE": {
            "content": "Mail::Box::Manage::User\nis a Mail::Box::Manager\nis a Mail::Reporter\n\nMail::Box::Manage::User is extended by\nMail::Server::IMAP4::User\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Mail::Box::Manage::User;\nuse User::Identity;\n\nmy $id      = User::Identity->new(...);\nmy $user    = Mail::Box::Manage::User->new\n( identity  => $id\n, folderdir => \"$ENV{HOME}/Mail\"\n, inbox     => $ENV{MAIL}\n);\n\nmy $inbox   = $user->open($user->inbox);\nmy $top     = $user->topfolder;\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Where the Mail::Box::Manager takes care of some set of open folder, this extension will add\nknowledge about some related person. At the same time, it will try to cache some information\nabout that person's folder files.\n\nExtends \"DESCRIPTION\" in Mail::Box::Manager.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "Extends \"METHODS\" in Mail::Box::Manager.\n",
            "subsections": [
                {
                    "name": "Constructors",
                    "content": "Extends \"Constructors\" in Mail::Box::Manager.\n\nMail::Box::Manage::User->new($args)\nUse new(defaultfoldertype) to explicitly state which kind of folders you use.\n\n-Option             --Defined in        --Default\nautodetect           Mail::Box::Manager  undef\ncollectiontype                          Mail::Box::Collection\ndefaultfoldertype  Mail::Box::Manager  'mbox'\ndelimiter                                \"/\"\nfolderidtype                           Mail::Box::Identity\nfoldertypes         Mail::Box::Manager  <all standard types>\nfolderdir            Mail::Box::Manager  [ '.' ]\nfolderdirs           Mail::Box::Manager  <synonym for C<folderdir>>\nidentity                                 <required>\ninbox                                    undef\nlog                  Mail::Reporter      'WARNINGS'\ntopfoldername                           '='\ntrace                Mail::Reporter      'WARNINGS'\n\nautodetect => TYPE|ARRAY-OF-TYPES\ncollectiontype => CLASS\nSubfolders grouped together.\n\ndefaultfoldertype => NAME|CLASS\ndelimiter => STRING\nThe separator used in folder names. This doesn't need to be the same as your directory\nsystem is using.\n\nfolderidtype => CLASS|OBJECT\nfoldertypes => NEW-TYPE | ARRAY-OF-NEW-TYPES\nfolderdir => DIRECTORY\nfolderdirs => [DIRECTORIES]\nidentity => OBJECT\nThe main difference between the Mail::Box::Manager and this class, is the concept of some\nperson (or virtual person) who's files are being administered by this object. The OBJECT\nis an User::Identity.\n\nThe smallest identity that will do: \"my $id = User::Identity->new('myname')\"\n\ninbox => NAME\nThe name of the user's inbox.\n\nlog => LEVEL\ntopfoldername => STRING\ntrace => LEVEL\n"
                },
                {
                    "name": "Attributes",
                    "content": "Extends \"Attributes\" in Mail::Box::Manager.\n\n$obj->defaultFolderType()\nInherited, see \"Attributes\" in Mail::Box::Manager\n\n$obj->folderTypes()\nInherited, see \"Attributes\" in Mail::Box::Manager\n\n$obj->folderdir()\nInherited, see \"Attributes\" in Mail::Box::Manager\n\n$obj->identity()\nReturns a User::Identity object.\n\n$obj->inbox( [$name] )\n(Set and) get the $name of the mailbox which is considered the folder for incoming mail. In\nmany protocols, this folder is handled separately. For instance in IMAP this is the only\ncase-insensitive folder name.\n\n$obj->registerType($type, $class, %options)\nInherited, see \"Attributes\" in Mail::Box::Manager\n"
                },
                {
                    "name": "Manage open folders",
                    "content": "Extends \"Manage open folders\" in Mail::Box::Manager.\n\n$obj->close($folder, %options)\nInherited, see \"Manage open folders\" in Mail::Box::Manager\n\n$obj->closeAllFolders(, %options)\nInherited, see \"Manage open folders\" in Mail::Box::Manager\n\n$obj->isOpenFolder($folder)\nInherited, see \"Manage open folders\" in Mail::Box::Manager\n\n$obj->open( [$foldername], %options )\nInherited, see \"Manage open folders\" in Mail::Box::Manager\n\n$obj->openFolders()\nInherited, see \"Manage open folders\" in Mail::Box::Manager\n"
                },
                {
                    "name": "Manage existing folders",
                    "content": "Extends \"Manage existing folders\" in Mail::Box::Manager.\n"
                },
                {
                    "name": "Manage folders",
                    "content": "$obj->create($name, %options)\nCreates a new folder with the specified name. An folder's administrative structure\n(Mail::Box::Identity) is returned, but the folder is not opened.\n\nIn the accidental case that the folder already exists, a warning will be issued, and an\nempty list/undef returned.\n\nThe %options are passed to Mail::Box::create() of your default folder type, except for the\noptions intended for this method itself.\n\n-Option       --Default\ncreatereal    <true>\ncreatesupers  <false>\ndeleted        <false>\nidoptions     []\n\ncreatereal => BOOLEAN\nWhen this option is false, the pysical folder will not be created, but only the\nadministration is updated.\n\ncreatesupers => BOOLEAN\nWhen you create a folder where upper hierarchy level are missing, they will be created as\nwell.\n\ndeleted => BOOLEAN\nThe folder starts as deleted.\n\nidoptions => ARRAY\nValues passed to the instantiated Mail::Box::Identity. That object is very picky about the\ninitiation values it accepts.\n\n$obj->delete($name)\nRemove all signs from the folder on the file-system. Messages still in the folder will be\nremoved. This method returns a true value when the folder has been removed or not found, so\n\"false\" means failure.\n\nIt is also possible to delete a folder using \"$folder->delete\", which will call this method\nhere. OPTIONS, which are used for some other folder types, will be ignored here: the user's\nindex contains the required details.\n\n-Option   --Defined in        --Default\nrecursive  Mail::Box::Manager  <folder's default>\n\nrecursive => BOOLEAN\n\nexample: how to delete a folder\n\nprint \"no xyz (anymore)\\n\" if $user->delete('xyz');\n\n$obj->folder($name)\nReturns the folder description, a Mail::Box::Identity.\n\n$obj->folderCollection($name)\nReturns a pair: the folder collection (Mail::Box::Collection) and the base name of $name.\n\n$obj->rename($oldname, $newname, %options)\nRename the folder with name $oldname to $newname. Both names are full pathnames.\n\n-Option       --Default\ncreatesupers  <false>\n\ncreatesupers => BOOLEAN\nWhen you rename a folder to a place where upper hierarchy levels are missing, they will\nget be defined, but with the deleted flag set.\n\n$obj->topfolder()\nReturns the top folder of the user's mailbox storage.\n"
                },
                {
                    "name": "Move messages to folders",
                    "content": "Extends \"Move messages to folders\" in Mail::Box::Manager.\n\n$obj->appendMessage( [$folder|$foldername], $messages, %options )\nInherited, see \"Move messages to folders\" in Mail::Box::Manager\n\n$obj->copyMessage( [$folder|$foldername], $messages, %options )\nInherited, see \"Move messages to folders\" in Mail::Box::Manager\n\n$obj->moveMessage( [$folder|$foldername], $messages, %options )\nInherited, see \"Move messages to folders\" in Mail::Box::Manager\n"
                },
                {
                    "name": "Manage message threads",
                    "content": "Extends \"Manage message threads\" in Mail::Box::Manager.\n\n$obj->threads( [$folders], %options )\nInherited, see \"Manage message threads\" in Mail::Box::Manager\n"
                },
                {
                    "name": "Internals",
                    "content": "Extends \"Internals\" in Mail::Box::Manager.\n\n$obj->decodeFolderURL($url)\nInherited, see \"Internals\" in Mail::Box::Manager\n\n$obj->toBeThreaded($folder, $messages)\nInherited, see \"Internals\" in Mail::Box::Manager\n\n$obj->toBeUnthreaded($folder, $messages)\nInherited, see \"Internals\" in Mail::Box::Manager\n"
                },
                {
                    "name": "Error handling",
                    "content": "Extends \"Error handling\" in Mail::Box::Manager.\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, $callback] )\nMail::Box::Manage::User->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::Manage::User->log( [$level, [$strings]] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->logPriority($level)\nMail::Box::Manage::User->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"
                },
                {
                    "name": "Cleanup",
                    "content": "Extends \"Cleanup\" in Mail::Box::Manager.\n\n$obj->DESTROY()\nInherited, see \"Cleanup\" in Mail::Reporter\n"
                }
            ]
        },
        "DETAILS": {
            "content": "Extends \"DETAILS\" in Mail::Box::Manager.\n",
            "subsections": []
        },
        "DIAGNOSTICS": {
            "content": "Error: Cannot create $name: higher levels missing\nUnless you set create(createsupers), all higher level folders must exist before this new\none can be created.\n\nError: Cannot rename $name to $new: higher levels missing\nUnless you set create(createsupers), all higher level folders must exist before this new\none can be created.\n\nError: Folder $name is already open.\nYou cannot ask the manager for a folder which is already open. In some older releases\n(before MailBox 2.049), this was permitted, but then behaviour changed, because many nasty\nside-effects are to be expected. For instance, an Mail::Box::update() on one folder handle\nwould influence the second, probably unexpectedly.\n\nError: Folder $name is not a Mail::Box; cannot add a message.\nThe folder where the message should be appended to is an object which is not a folder type\nwhich extends Mail::Box. Probably, it is not a folder at all.\n\nWarning: Folder does not exist, failed opening $type folder $name.\nThe folder does not exist and creating is not permitted (see open(create)) or did not\nsucceed. When you do not have sufficient access rights to the folder (for instance wrong\npassword for POP3), this warning will be produced as well.\n\nThe manager tried to open a folder of the specified type. It may help to explicitly state\nthe type of your folder with the \"type\" option. There will probably be another warning or\nerror message which is related to this report and provides more details about its cause. You\nmay also have a look at new(autodetect) and new(foldertypes).\n\nWarning: Folder type $type is unknown, using autodetect.\nThe specified folder type (see open(type), possibly derived from the folder name when\nspecified as url) is not known to the manager. This may mean that you forgot to require the\nMail::Box extension which implements this folder type, but probably it is a typo. Usually,\nthe manager is able to figure-out which type to use by itself.\n\nError: Illegal folder URL '$url'.\nThe folder name was specified as URL, but not according to the syntax. See decodeFolderURL()\nfor an description of the syntax.\n\nError: No foldername specified to open.\nopen() needs a folder name as first argument (before the list of options), or with the\n\"folder\" option within the list. If no name was found, the MAIL environment variable is\nchecked. When even that does not result in a usable folder, then this error is produced. The\nerror may be caused by an accidental odd-length option list.\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: Unable to remove folder $dir\nError: Use appendMessage() to add messages which are not in a folder.\nYou do not need to copy this message into the folder, because you do not share the message\nbetween folders.\n\nWarning: Use moveMessage() or copyMessage() to move between open folders.\nThe message is already part of a folder, and now it should be appended to a different\nfolder. You need to decide between copy or move, which both will clone the message (not the\nbody, because they are immutable).\n\nWarning: Will never create a folder $name without having write access.\nYou have set open(create), but only want to read the folder. Create is only useful for\nfolders which have write or append access modes (see Mail::Box::new(access)).\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "This module is part of Mail-Box distribution version 3.010, built on July 18, 2023. Website:\nhttp://perl.overmeer.net/CPAN/\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "Copyrights 2001-2023 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": []
        }
    },
    "summary": "Mail::Box::Manage::User - manage the folders of a user",
    "flags": [],
    "examples": [],
    "see_also": []
}