METHODS

See METHODS in Mail::Reporter

Constructors

$class->new( ARGS )

Use new(default_folder_type) to explicitly state which kind of folders you use.

Option Defined in Default

autodetect

Mail::Box::Manager

undef

collection_type

Mail::Box::Collection

default_folder_type

Mail::Box::Manager

'mbox'

delimiter

"/"

folder_id_type

Mail::Box::Identity

folder_types

Mail::Box::Manager

<all standard types>

folderdir

Mail::Box::Manager

[ '.' ]

folderdirs

Mail::Box::Manager

<synonym for folderdir>

identity

<required>

inbox

undef

log

Mail::Reporter

'WARNINGS'

topfolder_name

'='

trace

Mail::Reporter

'WARNINGS'

autodetect => TYPE|ARRAY-OF-TYPES
collection_type => CLASS
Subfolders grouped together.
default_folder_type => NAME|CLASS
delimiter => STRING
The separator used in folder names. This doesn't need to be the same as your directory system is using.
folder_id_type => CLASS|OBJECT
folder_types => NEW-TYPE | ARRAY-OF-NEW-TYPES
folderdir => DIRECTORY
folderdirs => [DIRECTORIES]
identity => OBJECT
The main difference between the Mail::Box::Manager and this class, is the concept of some person (or virtual person) who's files are being administered by this object. The OBJECT is an User::Identity.
The smallest identity that will do: < my $id = User::Identity->new('myname') >
inbox => NAME
The name of the user's inbox.
log => LEVEL
topfolder_name => STRING
trace => LEVEL

Attributes

$obj->defaultFolderType
See defaultFolderType in Mail::Box::Manager.
$obj->folderTypes
See folderTypes in Mail::Box::Manager.
$obj->folderdir
See folderdir in Mail::Box::Manager.
$obj->identity

Returns a User::Identity object.

$obj->inbox( [NAME] )

(Set and) get the NAME of the mailbox which is considered the folder for incoming mail. In many protocols, this folder is handled separately. For instance in IMAP this is the only case-insensitive folder name.

$obj->registerType( TYPE, CLASS [,OPTIONS] )
See registerType in Mail::Box::Manager.

Manage open folders

$obj->close( FOLDER, OPTIONS )
See close in Mail::Box::Manager.
$obj->closeAllFolders( , OPTIONS )
See closeAllFolders in Mail::Box::Manager.
$obj->isOpenFolder( FOLDER )
See isOpenFolder in Mail::Box::Manager.
$obj->open( [FOLDERNAME], OPTIONS )
See open in Mail::Box::Manager.
$obj->openFolders
See openFolders in Mail::Box::Manager.

Manage existing folders

$obj->create( NAME, OPTIONS )

Creates a new folder with the specified name. An folder's administrative structure (Mail::Box::Identity) is returned, but the folder is not opened.

In the accidental case that the folder already exists, a warning will be issued, and an empty list/undef returned.

The OPTIONS are passed to Mail::Box::create() of your default folder type, except for the options intended for this method itself.

Option Default

create_real

<true>

create_supers

<false>

deleted

<false>

id_options

[]

create_real => BOOLEAN
When this option is false, the pysical folder will not be created, but only the administration is updated.
create_supers => BOOLEAN
When you create a folder where upper hierarchy level are missing, they will be created as well.
deleted => BOOLEAN
The folder starts as deleted.
id_options => ARRAY
Values passed to the instantiated Mail::Box::Identity. That object is very picky about the initiation values it accepts.
» Error: Cannot create $name: higher levels missing

Unless you set create(create_supers), all higher level folders must exist before this new one can be created.

$obj->delete( NAME )

Remove all signs from the folder on the file-system. Messages still in the folder will be removed. This method returns a true value when the folder has been removed or not found, so "false" means failure.

It is also possible to delete a folder using < $folder->delete >, which will call this method here. OPTIONS, which are used for some other folder types, will be ignored here: the user's index contains the required details.

Option Defined in Default

recursive

Mail::Box::Manager

<folder's default>

recursive => BOOLEAN
» Example: how to delete a folder
 print "no xyz (anymore)\n" if $user->delete('xyz');
» Error: Unable to remove folder $dir
$obj->folder( NAME )

Returns the folder description, a Mail::Box::Identity.

$obj->folderCollection( NAME )

Returns a pair: the folder collection (Mail::Box::Collection) and the base name of NAME.

$obj->rename( OLDNAME, NEWNAME, OPTIONS )

Rename the folder with name OLDNAME to NEWNAME. Both names are full pathnames.

Option Default

create_supers

<false>

create_supers => BOOLEAN
When you rename a folder to a place where upper hierarchy levels are missing, they will get be defined, but with the deleted flag set.
» Error: Cannot rename $name to $new: higher levels missing

Unless you set create(create_supers), all higher level folders must exist before this new one can be created.

$obj->topfolder

Returns the top folder of the user's mailbox storage.

Move messages to folders

$obj->appendMessage( [FOLDER|FOLDERNAME,] MESSAGES, OPTIONS )
See appendMessage in Mail::Box::Manager.
$obj->copyMessage( [FOLDER|FOLDERNAME,] MESSAGES, OPTIONS )
See copyMessage in Mail::Box::Manager.
$obj->moveMessage( [FOLDER|FOLDERNAME,] MESSAGES, OPTIONS )
See moveMessage in Mail::Box::Manager.

Manage message threads

$obj->threads( [FOLDERS], OPTIONS )
See threads in Mail::Box::Manager.

Internals

$obj->decodeFolderURL( URL )
See decodeFolderURL in Mail::Box::Manager.
$obj->toBeThreaded( FOLDER, MESSAGES )
See toBeThreaded in Mail::Box::Manager.
$obj->toBeUnthreaded( FOLDER, MESSAGES )
See toBeUnthreaded in Mail::Box::Manager.

Error handling

$obj->AUTOLOAD
See AUTOLOAD in Mail::Reporter.
$obj->addReport( OBJECT )
See addReport in Mail::Reporter.
$obj->defaultTrace( [LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK] )
$class->defaultTrace( [LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK] )
See defaultTrace in Mail::Reporter.
$obj->errors
See errors in Mail::Reporter.
$obj->log( [LEVEL [,STRINGS]] )
$class->log( [LEVEL [,STRINGS]] )
See log in Mail::Reporter.
$obj->logPriority( LEVEL )
$class->logPriority( LEVEL )
See logPriority in Mail::Reporter.
$obj->logSettings
See logSettings in Mail::Reporter.
$obj->notImplemented
See notImplemented in Mail::Reporter.
$obj->report( [LEVEL] )
See report in Mail::Reporter.
$obj->reportAll( [LEVEL] )
See reportAll in Mail::Reporter.
$obj->trace( [LEVEL] )
See trace in Mail::Reporter.
$obj->warnings
See warnings in Mail::Reporter.

Cleanup

$obj->DESTROY
See DESTROY in Mail::Reporter.