ZurmoImap Class Reference

Inheritance diagram for ZurmoImap:
ZurmoBounce

Public Member Functions

 init ()
 loadInboundSettings ()
 setInboundSettings ()
 connect ()
 getMessageBoxStatsDetailed ()
 resolveMessageBoxStats ()
 getMessages ($searchCriteria= 'ALL', $messagesSinceTimestamp=0)
 expungeMessages ()
 deleteMessages ($expunge=false)
 deleteMessage ($msgUid)

Data Fields

 $imapHost
 $imapUsername
 $imapPassword
 $imapPort = 143
 $imapSSL = false
 $imapFolder = 'INBOX'

Protected Member Functions

 getMessage ($messageNumber, $mailHeaderInfo)
 getAttachments ($structure, $messageId)
 getMessageUId ($msgNo)
 mailCount ($query)
 getMimeType ($structure)
 getPart ($msgNumber, $mimeType, $structure=null, $partNumber=false)
 resolvePasswordKeyName ()
 resolveAttributeNameFromSettingsKey ($key)
 resolveAndParseMessageHeaders ($messageNumber)

Protected Attributes

 $imapStream
 $settingsToLoad

Detailed Description

Helper class to manage access to IMAP server

Definition at line 40 of file ZurmoImap.php.


Member Function Documentation

init (  ) 

Called once per page load, will load up outbound settings from the database if available. (non-PHPdoc)

See also:
CApplicationComponent::init()

Definition at line 96 of file ZurmoImap.php.

loadInboundSettings (  ) 

Load inbound settings from the database.

Definition at line 105 of file ZurmoImap.php.

setInboundSettings (  ) 

Set inbound settings into the database.

Definition at line 136 of file ZurmoImap.php.

connect (  ) 

Connect to imap server

Exceptions:
CException 
Returns:
bool

Definition at line 158 of file ZurmoImap.php.

getMessageBoxStatsDetailed (  ) 

Get detailed info about imap mail box

Definition at line 201 of file ZurmoImap.php.

resolveMessageBoxStats (  ) 

Get info about imap mail box

Definition at line 209 of file ZurmoImap.php.

getMessage ( messageNumber,
mailHeaderInfo 
) [protected]

Get email with attachments

Parameters:
int messageNumbers - message number
Object $mailHeaderInfo
Returns:
array the email info

Definition at line 224 of file ZurmoImap.php.

getMessages ( searchCriteria = 'ALL',
messagesSinceTimestamp = 0 
)

Get all messages, that satisfy some criteria, for example: 'ALL', 'UNSEEN', 'SUBJECT "Hello"'

Parameters:
string $searchCriteria
int $messagesSinceTimestamp
Returns:
array the messages that was found

Definition at line 318 of file ZurmoImap.php.

expungeMessages (  ) 

Expunge all messages on IMAP server

Definition at line 344 of file ZurmoImap.php.

deleteMessages ( expunge = false  ) 

Delete all messages on IMAP server

Definition at line 357 of file ZurmoImap.php.

deleteMessage ( msgUid  ) 

Delete message on IMAP server

Parameters:
int $msgUid
Returns:
mixed bool false if there is no imapStream available, otherwise result of imap_delete

Definition at line 379 of file ZurmoImap.php.

getAttachments ( structure,
messageId 
) [protected]

Get all message attachments

Parameters:
object $structure
int $messageId

Definition at line 393 of file ZurmoImap.php.

getMessageUId ( msgNo  )  [protected]

Get a sequenced message id

Parameters:
string $msgNo in the format <.*@.*> from the email
Returns:
mixed on imap its the unique id (int) and for others its a base64_encoded string

Definition at line 457 of file ZurmoImap.php.

mailCount ( query  )  [protected]

get the count of mails for the given conditions and params

Todo:
conditions / order other find params
Parameters:
array $query conditions for the query
Returns:
int the number of emails found

Definition at line 474 of file ZurmoImap.php.

getMimeType ( structure  )  [protected]
Parameters:
$structure 
Returns:
string

Definition at line 487 of file ZurmoImap.php.

getPart ( msgNumber,
mimeType,
structure = null,
partNumber = false 
) [protected]
Parameters:
$msgNumber 
$mimeType 
null $structure
bool $partNumber
Returns:
bool|string

Definition at line 505 of file ZurmoImap.php.


Field Documentation

$imapPort = 143

IMAP port

Definition at line 60 of file ZurmoImap.php.

$imapSSL = false

Does IMAP server require secure connection

Definition at line 65 of file ZurmoImap.php.

$imapFolder = 'INBOX'

IMAP folder

Definition at line 70 of file ZurmoImap.php.

$imapStream [protected]

IMAP stream. It is setup after connection to IMAP server established.

Definition at line 75 of file ZurmoImap.php.

$settingsToLoad [protected]
Initial value:
 array(
            'imapHost',
            'imapUsername',
            'imapPassword',
            'imapPort',
            'imapSSL',
            'imapFolder'
        )

Definition at line 82 of file ZurmoImap.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Thu Jul 27 07:10:31 2017