Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  MAIL::BOX::IDENTITY (3)

.ds Aq ’


Mail::Box::Identity - represents an unopened folder



   is a User::Identity::Item

   is a Mail::Reporter


 use User::Identity;
 use Mail::Box::Identity;
 my $me   = User::Identity->new(...);

 my $mailbox = Mail::Box::Identity->new(...);
 $me->add(folders => $mailbox);

 # Simpler

 use User::Identity;
 my $me   = User::Identity->new(...);
 my $addr = $me->add(folders => ...);


The Mail::Box::Identity object contains the description of a single mailbox. The mailboxes are collected by an Mail::Box::Collection object. This corresponds with IMAP’s \NoSelect, for instance.

Nearly all methods can return undef.

See documentation in the base class.

See documentation in the base class.


See documentation in the base class.

See documentation in the base class.


See documentation in the base class.

See documentation in the base class.
Mail::Box::Identity-><B>newB>([NAME], OPTIONS)

 -Option     --Defined in          --Default
  deleted                            <false>
  description  User::Identity::Item  undef
  folder_type                        from parent
  inferiors                          1
  location                           undef
  log          Mail::Reporter        WARNINGS
  manager                            <from parent>
  marked                             undef
  name         User::Identity::Item  <required>
  only_subs                          <foldertype and name dependent>
  parent       User::Identity::Item  undef
  subf_type                          <same as parent>
  trace        Mail::Reporter        WARNINGS

deleted => BOOLEAN The folder is flagged for deletion. This not have any implications yet, because it may still get undeleted.
description => STRING
folder_type => CLASS
inferiors => BOOLEAN Can this folder have children? If not, this is cleared.
location => DIRECTORY|FILENAME The location of this folder. Often, only the manager can figure-out where this folder really is.
log => LEVEL
manager => OBJECT Any Mail::Box::Manager or Mail::Box::Manage::User OBJECT.
marked => BOOLEAN|undef Whether the folder is flagged for some reason, for instance because new messages have arrived.
name => STRING
only_subs => BOOLEAN Some folder types can have messages in their toplevel folder, other cannot. That determines the default. See Mail::Box::topFolderWithMessages()
parent => OBJECT
subf_type => CLASS The type for a subfolder collection, must extend CLASS Mail::Box::Collection.
trace => LEVEL


See documentation in the base class.
$obj-><B>descriptionB>() See Attributes in User::Identity::Item
$obj-><B>folderTypeB>() Returns the type of this folder.
$obj-><B>fullnameB>([DELIMETER]) Returns the name of the folder, from the toplevel until this one, with the DELIMETER string between each level. DELIMETER default to a forward slash (a /).
$obj-><B>inferiorsB>([BOOLEAN]) Inferiors are subfolders. When this flag is set, it is permitted to create subfolders.
$obj-><B>locationB>([FILENAME|DIRECTORY|undef]) Returns the directory or filename of the folder. If this is not pre-defined, it is computed based on the knowledge about the folder type. Be sure to set the location of the toplevel folder to the folderdir of the user to get this to work.
$obj-><B>managerB>() Returns the manager (usually a Mail::Box::Manage::User which owns the folders. May be undefined, by default from parent.
$obj-><B>markedB>([BOOLEAN|undef]) When something special has happened with the folder, this flag can be set (or cleared). The undef status is an unknown. In the IMAP4 protocol, 0 will result in a \Unmarked, a 1 results in a \Marked, and undef in nothing.
$obj-><B>nameB>([NEWNAME]) See Attributes in User::Identity::Item
$obj-><B>onlySubfoldersB>([BOOLEAN]) Than this folder be opened (without trying) or not? The default depends on the folder type, and whether this is the toplevel folder or not. See Mail::Box::topFolderWithMessages()
$obj-><B>topfolderB>() Run up the tree to find the highest level folder.


See documentation in the base class.
$obj-><B>addB>(COLLECTION, ROLE) See Collections in User::Identity::Item
$obj-><B>addCollectionB>(OBJECT | ([TYPE], OPTIONS)) See Collections in User::Identity::Item
$obj-><B>collectionB>(NAME) See Collections in User::Identity::Item
$obj-><B>findB>(COLLECTION, ROLE) See Collections in User::Identity::Item
$obj-><B>parentB>([PARENT]) See Collections in User::Identity::Item
$obj-><B>removeCollectionB>(OBJECT|NAME) See Collections in User::Identity::Item
Mail::Box::Identity-><B>typeB>() See Collections in User::Identity::Item
$obj-><B>userB>() See Collections in User::Identity::Item


$obj-><B>addSubfolderB>(Mail::Box::Identity|DATA) Add a new folder into the administration. With DATA, a new object will be instantiated first. The identity is returned on success.
$obj-><B>folderB>([[NAME, ...], NAME]) Returns the subfolder’s object with NAME or undef if it does not exist. When multiple NAMEs are added, those super folders are traverst first. Without any NAME, the current object is returned

example: get some folder

 my $a = $user->folders->folder(b, a);

 my $name  = "a:b:c";
 my $delim = ":";
 my $f = $user->folders->folder(split $delim, $name);

$obj-><B>foreachB>(CODE) For each of the subfolders found below this point call CODE. This current folder is called first. Be warned that you may find identities with the Mail::Box::Identity subroutine deleted flag on.
$obj-><B>openB>(OPTIONS) Open the folder which is described by this identity. Returned is some Mail::Box. The options are passed to Mail::Box::Manager::open().
$obj-><B>removeB>([NAME]) Remove the folder (plus subfolders) with the NAME. Without NAME, this Mail::Box::Identity itself is removed.

The removed structure is returned, which is undef if not found. This is only an administrative remove, you still need a Mail::Box::Manager::delete().

$obj-><B>renameB>(FOLDER, [NEWSUBNAME]) Move the folder to a different super-FOLDER, under a NEW SUBfolder NAME.

example: renaming a folder

 my $top = $user->topfolder;
 my $new = $top->folder(xyz) or die;
 my $f   = $top->folder(abc, def)->rename($new, 123);

 print $f->name;      # 123
 print $f->fullname;  # =/xyz/123

$obj-><B>subfolderNamesB>() Convenience method: returns the names of the collected subfolders.
$obj-><B>subfoldersB>() Returns the subfolders or undef if there are none. This information is lazy evaluated and cached. In LIST context, the folder objects are returned (Mail::Box::Identity objects), in SCALAR context the collection, the Mail::Box::Collection.

    Error handling

See documentation in the base class.
$obj-><B>AUTOLOADB>() See Error handling in Mail::Reporter
$obj-><B>addReportB>(OBJECT) See Error handling in Mail::Reporter
Mail::Box::Identity-><B>defaultTraceB>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK]) See Error handling in Mail::Reporter
$obj-><B>errorsB>() See Error handling in Mail::Reporter
$obj-><B>logB>([LEVEL [,STRINGS]])
Mail::Box::Identity-><B>logB>([LEVEL [,STRINGS]]) See Error handling in Mail::Reporter
Mail::Box::Identity-><B>logPriorityB>(LEVEL) See Error handling in Mail::Reporter
$obj-><B>logSettingsB>() See Error handling in Mail::Reporter
$obj-><B>notImplementedB>() See Error handling in Mail::Reporter
$obj-><B>reportB>([LEVEL]) See Error handling in Mail::Reporter
$obj-><B>reportAllB>([LEVEL]) See Error handling in Mail::Reporter
$obj-><B>traceB>([LEVEL]) See Error handling in Mail::Reporter
$obj-><B>warningsB>() See Error handling in Mail::Reporter


See documentation in the base class.
$obj-><B>DESTROYB>() See Cleanup in Mail::Reporter


Error: $object is not a collection. The first argument is an object, but not of a class which extends User::Identity::Collection.
Error: Cannot load collection module for $type ($class). Either the specified $type does not exist, or that module named $class returns compilation errors. If the type as specified in the warning is not the name of a package, you specified a nickname which was not defined. Maybe you forgot the ’require’ the package which defines the nickname.
Error: Creation of a collection via $class failed. The $class did compile, but it was not possible to create an object of that class using the options you specified.
Error: Don’t know what type of collection you want to add. If you add a collection, it must either by a collection object or a list of options which can be used to create a collection object. In the latter case, the type of collection must be specified.
Error: It is not permitted to add subfolders to $name The inferiors() flag prohibits the creation of subfolders to this folder.
Warning: No collection $name The collection with $name does not exist and can not be created.
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: The toplevel folder cannot be removed this way The Mail::Box::Identity folder administration structure requires a top directory. That top is registered somewhere (for instance by a Mail::Box::Manage::User). If you need to remove the top, you have to look for a method of that object.
Error: Toplevel directory requires explicit folder type
Error: Toplevel directory requires explicit location


This module is part of Mail-Box distribution version 2.109, built on August 19, 2013. Website:


Copyrights 2001-2013 by [Mark Overmeer]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See

Search for    or go to Top of page |  Section 3 |  Main Index

perl v5.20.3 MAIL::BOX::IDENTITY (3) 2013-08-19

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.