Path

ez components / documentation / api reference / 2009.1rc1 / mail


eZ Components 2009.1rc1

Mail: ezcMailMboxTransport

[ Tutorial ] [ Display example ] [ Mail listing example ] [ Rfcs ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcMailMboxTransport

ezcMailMboxTransport implements mail retrieval from an mbox file. [source]
The mbox set is constructed from a file pointer and iterates over all the messages in an mbox file.

Member Variables

public resource(filepointer) $fh
Holds the filepointer to the mbox

Method Summary

public ezcMailMboxTransport __construct( $fileName )
Constructs the ezcMailMboxTransport object
public ezcMailMboxSet fetchAll( )
Returns an ezcMailMboxSet containing all the messages in the mbox.
public ezcMailMboxSet fetchByMessageNr( $number )
Returns an ezcMailMboxSet containing only the $number -th message in the mbox.
public ezcMailMboxSet fetchFromOffset( $offset, [$count = 0] )
Returns an ezcMailMboxSet with $count messages starting from $offset.
public array(int=>int) listMessages( )
This function reads through the whole mbox and returns starting positions of the messages.

Methods

__construct

ezcMailMboxTransport __construct( string $fileName )
Constructs the ezcMailMboxTransport object
Opens the mbox $fileName.

Parameters

Name Type Description
$fileName string  

Throws

ClassDescription
ezcBaseFileNotFoundException if the mbox file could not be found.
ezcBaseFilePermissionException if the mbox file could be opened for reading.

fetchAll

ezcMailMboxSet fetchAll( )
Returns an ezcMailMboxSet containing all the messages in the mbox.

fetchByMessageNr

ezcMailMboxSet fetchByMessageNr( int $number )
Returns an ezcMailMboxSet containing only the $number -th message in the mbox.

Parameters

Name Type Description
$number int  

Throws

ClassDescription
ezcMailNoSuchMessageException if the message $number is out of range.

fetchFromOffset

ezcMailMboxSet fetchFromOffset( int $offset, [int $count = 0] )
Returns an ezcMailMboxSet with $count messages starting from $offset.
Fetches $count messages starting from the $offset and returns them as a ezcMailMboxSet. If $count is not specified or if it is 0, it fetches all messages starting from the $offset.

Parameters

Name Type Description
$offset int  
$count int  

Throws

ClassDescription
ezcMailInvalidLimitException if $count is negative.
ezcMailOffsetOutOfRangeException if $offset is outside of the existing range of messages.

listMessages

array(int=>int) listMessages( )
This function reads through the whole mbox and returns starting positions of the messages.

Last updated: Mon, 22 Jun 2009