Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: ../general-devel/lib/support/imap/imap.class.php
phpGeneral - support

Imap

Imap

Base class for imap api

 

private class Imap extends Locale

Base class for imap api
Provides various function implementations to access the standard imap apicalls for managing imap mailboxes. All member functions need a path to amailbox. This string must consist of the path components seperated by aslash ("/"), e.g. "mymailbox/myfolder".

AuthorsNorbert Sendetzky <norbert@linuxnetworks.de>

 
Direct known subclasses: Cyrus

Public Method Summary

boolean

createMailbox(string $path, string &$errmsg)

Create a new mailbox in the imap mailbox tree
boolean

deleteMailbox(string $path, string &$errmsg)

Deletes a mailbox in the imap mailbox tree
boolean

listMailbox(string $path, array &$result, string &$errmsg)

List the names of all mailboxs below the given mailbox
boolean

renameMailbox(string $oldpath, string $newpath, string &$errmsg)

Rename a mailbox
boolean

getQuota(string $path, int &$result, string &$errmsg)

Get the quota of a mailbox
boolean

setQuota(string $path, int $limit, string &$errmsg)

Set the quota of a mailbox

Private Method Summary

object Imap

Imap(array $param, string &$errmsg)

Class constructor
void

_Imap()

Class destructor
string

path2mailbox(string $path)

Translates a path to a mailbox string

Private Field Summary

integer

$mbox

string

$userid

string

$server

string

$delimiter

Included files Summary, Type: include_once

../lib/include/locale.class.php Warning: documentation is missing.

Public Method Details

createMailbox

public boolean createMailbox( string $path, string &$errmsg )

  Create a new mailbox in the imap mailbox tree
A new mailbox is created in the mailbox tree located where $path pointsto.

Parameter
string $path
Path and name of the new mailbox
string &$errmsg
Reference for storing error messages in case of a failure
Returns boolean

True on success, false otherwise


deleteMailbox

public boolean deleteMailbox( string $path, string &$errmsg )

  Deletes a mailbox in the imap mailbox tree
Removes the mailbox where $path is pointing to and all its contents.

Parameter
string $path
Path and name of the mailbox
string &$errmsg
Reference for storing error messages in case of a failure
Returns boolean

True on success, false otherwise


listMailbox

public boolean listMailbox( string $path, array &$result, string &$errmsg )

  List the names of all mailboxs below the given mailbox
Retrieves a list of all mailboxes which are located below the mailboxspecified by $path. The retrieved names are stored in the &$resultreference.

Parameter
string $path
Path of the base mailbox
array &$result
Reference for storing the retrieved names of the mailboxes
string &$errmsg
Reference for storing error messages in case of a failure
Returns boolean

True on success, false otherwise


renameMailbox

public boolean renameMailbox( string $oldpath, string $newpath, string &$errmsg )

  Rename a mailbox
Changes the name of a mailbox to a new one. This does not work on rootmailboxes and only on mailbox folders. It is also not possible to move amailbox to a different location.

Parameter
string $oldpath
Name of the old mailbox
string $newpath
Name of the new mailbox
string &$errmsg
Reference for storing error messages in case of a failure
Returns boolean

True on success, false otherwise


getQuota

public boolean getQuota( string $path, int &$result, string &$errmsg )

  Get the quota of a mailbox
Retrieves the maximum amount of space in kilobytes for mails in amailbox. This is also known as the "limit".

Parameter
string $path
Path to the mailbox
int &$result
Reference for storing the quota number
string &$errmsg
Reference for storing error messages in case of a failure
Returns boolean

True on success, false otherwise


setQuota

public boolean setQuota( string $path, int $limit, string &$errmsg )

  Set the quota of a mailbox
Sets the maximum amount of space for mails in a mailbox. This is alsoknown as the "limit".

Parameter
string $path
Path to the mailbox
int $limit
Limit of this mailbox in kilobytes
string &$errmsg
Reference for storing error messages in case of a failure
Returns boolean

True on success, false otherwise


Private Method Details

Imap

private object Imap Imap( array $param, string &$errmsg )

  Class constructor
Initializes localization support for error messages and connects to astandard compliant imap server. It also authenticates the userby providing the given userid and password to the server.

Parameter
array $param
Associative array contains userid, password, realm and others
string &$errmsg
Reference for storing error messages in case of a failure
Returns object Imap


_Imap

private void _Imap( )

  Class destructor
Close the connection to the ldap server

Returns void


path2mailbox

private string path2mailbox( string $path )

  Translates a path to a mailbox string
Replaces the standard delimiter between the component names with thedelimiter used by the imap server

Parameter
string $path
Path to a mailbox
Returns string

Mailbox string


Private Field Details

$mbox

private integer $mbox

>><<



$userid

private string $userid

>>""<<



$server

private string $server

>>""<<



$delimiter

private string $delimiter

>>"/"<<



Included Files, Type: include_once

../lib/include/locale.class.php

include_once( ../lib/include/locale.class.php )




Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta