1824. Class

1824.1. Zend\Mail\Storage\Mbox

1824.1.1. Methods

1824.1.1.1. countMessages

countMessages()

Count messages all messages in current box

Return type:int number of messages
Throws :ZendMailStorageExceptionExceptionInterface

1824.1.1.2. getSize

getSize()

Get a list of messages with number and size

Parameters:int|null – number of message or null for all messages
Return type:int|array size of given message of list with all messages as array(num => size)

1824.1.1.3. getPos

getPos()

Get positions for mail message or throw exception if id is invalid

Parameters:int – number of message
Throws ExceptionInvalidArgumentException:
 
Return type:array positions as in positions

1824.1.1.4. getMessage

getMessage()

Fetch a message

Parameters:int – number of message
Return type:ZendMailStorageMessageFile
Throws :ZendMailStorageExceptionExceptionInterface

1824.1.1.5. getRawHeader

getRawHeader()

1824.1.1.6. getRawContent

getRawContent()

1824.1.1.7. __construct

__construct()

Create instance with parameters Supported parameters are:

  • filename filename of mbox file
Parameters:$params – mail reader specific parameters
Throws ExceptionInvalidArgumentException:
 

1824.1.1.8. isMboxFile

isMboxFile()

check if given file is a mbox file

if $file is a resource its file pointer is moved after the first line

Parameters:
  • resource|string – stream resource of name of file
  • bool – file is string or resource
Return type:

bool file is mbox file

1824.1.1.9. openMboxFile

openMboxFile()

open given file as current mbox file

Parameters:string – filename of mbox file
Throws ExceptionRuntimeException:
 
Throws ExceptionInvalidArgumentException:
 

1824.1.1.10. close

close()

Close resource for mail lib. If you need to control, when the resource is closed. Otherwise the destructor would call this.

1824.1.1.11. noop

noop()

Waste some CPU cycles doing nothing.

Return type:bool always return true

1824.1.1.12. removeMessage

removeMessage()

stub for not supported message deletion

Parameters:$id
Throws ExceptionRuntimeException:
 

1824.1.1.13. getUniqueId

getUniqueId()

get unique id for one or all messages

Mbox does not support unique ids (yet) - it’s always the same as the message number. That shouldn’t be a problem, because we can’t change mbox files. Therefor the message number is save enough.

Parameters:int|null – message number
Return type:array|string message number for given message or all messages as array
Throws :ZendMailStorageExceptionExceptionInterface

1824.1.1.14. getNumberByUniqueId

getNumberByUniqueId()

get a message number from a unique id

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()

Parameters:string – unique id
Return type:int message number
Throws :ZendMailStorageExceptionExceptionInterface

1824.1.1.15. __sleep

__sleep()

magic method for serialize()

with this method you can cache the mbox class

Return type:array name of variables

1824.1.1.16. __wakeup

__wakeup()

magic method for unserialize()

with this method you can cache the mbox class for cache validation the mtime of the mbox file is used