Methods
Create instance with parameters
Additional parameters are (see parent for more):
- create if true a new maildir is create if none exists
__construct(\Zend\Mail\Storage\Writable\$params $params)
Parameters
$params
\Zend\Mail\Storage\Writable\$params
array mail reader specific parameters
Exceptions
Destructor calls close() and therefore closes the resource.
__destruct()
Inherited
inherited_from |
\Zend\Mail\Storage\AbstractStorage::__destruct() |
inherited_from |
\Zend\Mail\Storage\Maildir::__destruct() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::__destruct() |
Getter for has-properties.
__get(string $var) : bool
Inherited
The standard has properties
are: hasFolder, hasUniqueid, hasDelete, hasCreate, hasTop
The valid values for the has-properties are:
- true if a feature is supported
- false if a feature is not supported
- null is it's not yet known or it can't be know if a feature is supported
inherited_from |
\Zend\Mail\Storage\AbstractStorage::__get() |
inherited_from |
\Zend\Mail\Storage\Maildir::__get() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::__get() |
Parameters
Exceptions
Returns
bool
supported or not
check if storage is currently over quota
checkQuota(bool $detailedResponse, bool $forceRecalc) : bool | array
see |
\Zend\Mail\Storage\Writable\_calculateQuota() |
Parameters
$detailedResponse
bool
return known data of quota and current size and message count
$forceRecalc
bool
Returns
bool
array
over quota state or detailed response
Close resource for mail lib.
close()
Inherited
If you need to control, when the resource
is closed. Otherwise the destructor would call this.
inherited_from |
\Zend\Mail\Storage\Maildir::close() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::close() |
Countable::count()
count() : int
Inherited
inherited_from |
\Zend\Mail\Storage\AbstractStorage::count() |
inherited_from |
\Zend\Mail\Storage\Maildir::count() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::count() |
Returns
int
Count messages all messages in current box
countMessages(mixed $flags) : int
Inherited
inherited_from |
\Zend\Mail\Storage\Maildir::countMessages() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::countMessages() |
Parameters
$flags
mixed
Exceptions
Returns
int
number of messages
create a new folder
createFolder(string $name, string | \Zend\Mail\Storage\Folder $parentFolder) : string
This method also creates parent folders if necessary. Some mail storages may restrict, which folder
may be used as parent or which chars may be used in the folder name
Parameters
$name
string
global name of folder, local name if $parentFolder is set
Exceptions
Returns
string
only used internally (new created maildir)
Iterator::current()
current() : \Zend\Mail\Storage\Message
Inherited
inherited_from |
\Zend\Mail\Storage\AbstractStorage::current() |
inherited_from |
\Zend\Mail\Storage\Maildir::current() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::current() |
Returns
Get a full list of features supported by the specific mail lib and the server
getCapabilities() : array
Inherited
inherited_from |
\Zend\Mail\Storage\AbstractStorage::getCapabilities() |
inherited_from |
\Zend\Mail\Storage\Maildir::getCapabilities() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::getCapabilities() |
Returns
array
list of features as array(feature_name => true|false[|null])
get \Zend\Mail\Storage\Folder instance for current folder
getCurrentFolder() : \Zend\Mail\Storage\Folder
Inherited
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::getCurrentFolder() |
Exceptions
Returns
get root folder or given folder
getFolders(string $rootFolder) : \Zend\Mail\Storage\Folder
Inherited
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::getFolders() |
Parameters
$rootFolder
string
get folder structure for given folder, else root
Exceptions
Returns
Fetch a message
getMessage(int $id) : \Zend\Mail\Storage\Message\File
Inherited
inherited_from |
\Zend\Mail\Storage\Maildir::getMessage() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::getMessage() |
Parameters
Exceptions
Returns
get a message number from a unique id
getNumberByUniqueId(string $id) : int
Inherited
I.e. if you have a webmailer that supports deleting messages you should use unique ids
as parameter and use this method to translate it to message number right before calling removeMessage()
inherited_from |
\Zend\Mail\Storage\Maildir::getNumberByUniqueId() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::getNumberByUniqueId() |
Parameters
Exceptions
Returns
int
message number
get currently set quota
getQuota(bool $fromStorage) : bool | array
see |
\Zend\Mail\Storage\Writable\Maildir::setQuota() |
Parameters
$fromStorage
bool
Exceptions
Returns
bool
array
Get raw content of message or part
getRawContent(int $id, null | array | string $part) : string
Inherited
inherited_from |
\Zend\Mail\Storage\Maildir::getRawContent() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::getRawContent() |
Parameters
$part
nullarraystring
path to part or null for message content
Returns
string
raw content
Get a list of messages with number and size
getSize(int | null $id) : int | array
Inherited
inherited_from |
\Zend\Mail\Storage\Maildir::getSize() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::getSize() |
Parameters
$id
intnull
number of message or null for all messages
Returns
int
array
size of given message of list with all messages as array(num => size)
get unique id for one or all messages
getUniqueId(int | null $id) : array | string
Inherited
if storage does not support unique ids it's the same as the message number
inherited_from |
\Zend\Mail\Storage\Maildir::getUniqueId() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::getUniqueId() |
Parameters
$id
intnull
message number
Exceptions
Returns
array
string
message number for given message or all messages as array
create a new maildir
initMaildir(string $dir)
If the given dir is already a valid maildir this will not fail.
Parameters
$dir
string
directory for the new maildir (may already exist)
Exceptions
Iterator::key()
key() : int
Inherited
inherited_from |
\Zend\Mail\Storage\AbstractStorage::key() |
inherited_from |
\Zend\Mail\Storage\Maildir::key() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::key() |
Returns
int
id of current position
Iterator::next()
next()
Inherited
inherited_from |
\Zend\Mail\Storage\AbstractStorage::next() |
inherited_from |
\Zend\Mail\Storage\Maildir::next() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::next() |
Waste some CPU cycles doing nothing.
noop() : bool
Inherited
inherited_from |
\Zend\Mail\Storage\Maildir::noop() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::noop() |
Returns
bool
always return true
ArrayAccess::offsetExists()
offsetExists(int $id) : bool
Inherited
inherited_from |
\Zend\Mail\Storage\AbstractStorage::offsetExists() |
inherited_from |
\Zend\Mail\Storage\Maildir::offsetExists() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::offsetExists() |
Parameters
$id
int
Returns
bool
ArrayAccess::offsetGet()
offsetGet(int $id) : \Zend\Mail\Storage\Message
Inherited
inherited_from |
\Zend\Mail\Storage\AbstractStorage::offsetGet() |
inherited_from |
\Zend\Mail\Storage\Maildir::offsetGet() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::offsetGet() |
Parameters
$id
int
Returns
ArrayAccess::offsetSet()
offsetSet(mixed $id, mixed $value)
Inherited
inherited_from |
\Zend\Mail\Storage\AbstractStorage::offsetSet() |
inherited_from |
\Zend\Mail\Storage\Maildir::offsetSet() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::offsetSet() |
Parameters
$id
mixed
$value
mixed
Exceptions
ArrayAccess::offsetUnset()
offsetUnset(int $id) : bool
Inherited
inherited_from |
\Zend\Mail\Storage\AbstractStorage::offsetUnset() |
inherited_from |
\Zend\Mail\Storage\Maildir::offsetUnset() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::offsetUnset() |
Parameters
$id
int
Returns
bool
success
stub for not supported message deletion
removeMessage($id)
Parameters
$id
Exceptions
rename and/or move folder
renameFolder(string | \Zend\Mail\Storage\Folder $oldName, string $newName)
The new name has the same restrictions as in createFolder()
Parameters
$newName
string
new global name of folder
Exceptions
Iterator::rewind()
rewind()
Inherited
Rewind always gets the new count from the storage. Thus if you use
the interfaces and your scripts take long you should use reset()
from time to time.
inherited_from |
\Zend\Mail\Storage\AbstractStorage::rewind() |
inherited_from |
\Zend\Mail\Storage\Maildir::rewind() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::rewind() |
SeekableIterator::seek()
seek(int $pos)
Inherited
inherited_from |
\Zend\Mail\Storage\AbstractStorage::seek() |
inherited_from |
\Zend\Mail\Storage\Maildir::seek() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::seek() |
Parameters
$pos
int
Exceptions
select given folder
selectFolder(\Zend\Mail\Storage\Folder | string $globalName)
Inherited
folder must be selectable!
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::selectFolder() |
Parameters
Exceptions
set flags for message
setFlags(int $id, array $flags)
NOTE: this method can't set the recent flag.
Parameters
$flags
array
new flags for message
Exceptions
enable/disable quota and set a quota value if wanted or needed
setQuota(bool | array $value)
You can enable/disable quota with true/false. If you don't have
a MDA or want to enforce a quota value you can also set this value
here. Use array('size' => SIZE_QUOTA, 'count' => MAX_MESSAGE) do
define your quota. Order of these fields does matter!
Parameters
$value
boolarray
new quota value
Iterator::valid()
valid() : bool
Inherited
inherited_from |
\Zend\Mail\Storage\AbstractStorage::valid() |
inherited_from |
\Zend\Mail\Storage\Maildir::valid() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::valid() |
Returns
bool
_addQuotaEntry()
_addQuotaEntry($size, $count)
find all subfolders and mbox files for folder structure
_buildFolderTree()
Inherited
Result is save in \Zend\Mail\Storage\Folder instances with the root in $this->rootFolder.
$parentFolder and $parentGlobalName are only used internally for recursion.
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::_buildFolderTree() |
Exceptions
_calculateMaildirsize()
_calculateMaildirsize() : array
see |
\Zend\Mail\Storage\Writable\http://www.inter7.com/courierimap/README.maildirquota.html |
Exceptions
Returns
array
_calculateQuota()
_calculateQuota(bool $forceRecalc) : array
see |
\Zend\Mail\Storage\Writable\http://www.inter7.com/courierimap/README.maildirquota.html |
Parameters
$forceRecalc
bool
Returns
array
open a temporary maildir file
_createTmpFile(string $folder) : array
makes sure tmp/ exists and create a file with a unique name
you should close the returned filehandle!
Parameters
$folder
string
name of current folder without leading .
Exceptions
Returns
array
array('dirname' => dir of maildir folder, 'uniq' => unique id, 'filename' => name of create file 'handle' => file opened for writing)
create a uniqueid for maildir filename
_createUniqueId() : string
This is nearly the format defined in the maildir standard. The microtime() call should already
create a uniqueid, the pid is for multicore/-cpu machine that manage to call this function at the
exact same time, and uname() gives us the hostname for multiple machines accessing the same storage.
If someone disables posix we create a random number of the same size, so this method should also
work on Windows - if you manage to get maildir working on Windows.
Microtime could also be disabled, although I've never seen it.
Returns
string
new uniqueid
Get one or all fields from file structure.
_getFileData(int $id, string | null $field) : string | array
Inherited
Also checks if message is valid
inherited_from |
\Zend\Mail\Storage\Maildir::_getFileData() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::_getFileData() |
Parameters
$field
stringnull
wanted field
Exceptions
Returns
string
array
wanted field or all fields as array
create an info string for filenames with given flags
_getInfoString(array $flags) : string
Parameters
$flags
array
wanted flags, with the reference you'll get the set flags with correct key (= char for flag)
Exceptions
Returns
string
info string for version 2 filenames including the leading colon
find all files in opened dir handle and add to maildir files
_getMaildirFiles(resource $dh, string $dirname, array $defaultFlags)
Inherited
inherited_from |
\Zend\Mail\Storage\Maildir::_getMaildirFiles() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::_getMaildirFiles() |
Parameters
$dh
resource
dir handle used for search
$dirname
string
dirname of dir in $dh
$defaultFlags
array
default flags for given dir
check if a given dir is a valid maildir
_isMaildir(string $dirname) : bool
Inherited
inherited_from |
\Zend\Mail\Storage\Maildir::_isMaildir() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::_isMaildir() |
Parameters
$dirname
string
name of dir
Returns
bool
dir is valid maildir
open given dir as current maildir
_openMaildir(string $dirname)
Inherited
inherited_from |
\Zend\Mail\Storage\Maildir::_openMaildir() |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::_openMaildir() |
Parameters
$dirname
string
name of maildir
Exceptions
Properties
name of current folder
$currentFolder : string
Inherited
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::$$currentFolder |
delim char for subfolders
$delim : string
Inherited
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::$$delim |
data of found message files in maildir dir
$files : array
Inherited
inherited_from |
\Zend\Mail\Storage\Maildir::$$files |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::$$files |
class capabilities with default values
$has : array
Inherited
inherited_from |
\Zend\Mail\Storage\AbstractStorage::$$has |
inherited_from |
\Zend\Mail\Storage\Maildir::$$has |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::$$has |
maximum iteration position (= message count)
$iterationMax : null | int
Inherited
inherited_from |
\Zend\Mail\Storage\AbstractStorage::$$iterationMax |
inherited_from |
\Zend\Mail\Storage\Maildir::$$iterationMax |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::$$iterationMax |
current iteration position
$iterationPos : int
Inherited
inherited_from |
\Zend\Mail\Storage\AbstractStorage::$$iterationPos |
inherited_from |
\Zend\Mail\Storage\Maildir::$$iterationPos |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::$$iterationPos |
known flag chars in filenames
$knownFlags : array
Inherited
This list has to be in alphabetical order for setFlags()
inherited_from |
\Zend\Mail\Storage\Maildir::$$knownFlags |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::$$knownFlags |
used message class, change it in an extended class to extend the returned message class
$messageClass : string
Inherited
inherited_from |
\Zend\Mail\Storage\Maildir::$$messageClass |
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::$$messageClass |
use quota and size of quota if given
$quota : bool | int
root folder for folder structure
$rootFolder : \Zend\Mail\Storage\Folder
Inherited
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::$$rootFolder |
rootdir of folder structure
$rootdir : string
Inherited
inherited_from |
\Zend\Mail\Storage\Folder\Maildir::$$rootdir |