Methods |
public
|
__construct(AbstractModule $oModule = null): void
Initializes manager property.
Initializes manager property.
Overrides
|
#
|
public
&
|
_getImapClient(MailAccount $oAccount, int $iForceConnectTimeOut = 0, int $iForceSocketTimeOut = 0): ImapClient|null
Returns ImapClient object from cache.
Returns ImapClient object from cache.
Parameters
$oAccount |
Account object.
|
$iForceConnectTimeOut |
= 0. The value overrides connection timeout value.
|
$iForceSocketTimeOut |
= 0. The value overrides socket timeout value.
|
|
#
|
public
&
|
getImapClient(MailAccount $oAccount, type $iForceConnectTimeOut = 0, type $iForceSocketTimeOut = 0): ImapClient|null
Creates a new instance of ImapClient class.
Creates a new instance of ImapClient class.
Parameters
$oAccount |
Account object.
|
$iForceConnectTimeOut |
= 0. The value overrides connection timeout value.
|
$iForceSocketTimeOut |
= 0. The value overrides socket timeout value.
|
|
#
|
public
|
validateAccountConnection(MailAccount $oAccount, boolean $bThrowException = true): void
Checks if user of the account can successfully connect to mail server.
Checks if user of the account can successfully connect to mail server.
Parameters
$oAccount |
Account object.
|
$bThrowException |
= true
|
Throws
|
#
|
public
|
setAlwaysRefreshFolder($oAccount, $sFolderFullName, $bRefresh)
|
#
|
public
|
getAlwaysRefreshFolders($oAccount)
|
#
|
public
|
updateSystemFolderNames(MailAccount $oAccount, array $aSystemNames): bool
Updates information on system folders use.
Updates information on system folders use.
Parameters
$oAccount |
Account object.
|
$aSystemNames |
Array containing mapping of folder types and their actual IMAP names.
|
|
#
|
public
|
setSystemFolder($oAccount, $sFolderFullName, $iTypeValue, $bSet)
|
#
|
public
|
getSystemFolderNames(MailAccount $oAccount): array|bool
Gets information about system folders of the account.
Gets information about system folders of the account.
Parameters
$oAccount |
Account object.
|
|
#
|
public
|
deleteSystemFolderNames(int $iAccountId): boolean
Deletes information about system folders of the account.
Deletes information about system folders of the account.
Parameters
$iAccountId |
Account identifier.
|
|
#
|
public
|
isSafetySender($iIdUser, $sEmail)
|
#
|
public
|
setSafetySender($iIdUser, $sEmail)
|
#
|
public
|
getFoldersNamespace($oAccount)
|
#
|
public
|
getFolders(MailAccount $oAccount, bool $bCreateUnExistenSystemFolders = true, $sParent = ''): FolderCollection
Obtains the list of IMAP folders.
Obtains the list of IMAP folders.
Parameters
$oAccount |
Account object.
|
$bCreateUnExistenSystemFolders |
= true. Creating folders is required for WebMail work, usually it is done on first login to the account.
|
Returns
|
#
|
public
|
getFoldersOrder(MailAccount $oAccount): array
Obtains folders order.
Parameters
$oAccount |
Account object.
|
|
#
|
public
|
updateFoldersOrder(MailAccount $oAccount, array $aOrder): bool
Updates folders order.
Parameters
$oAccount |
Account object.
|
$aOrder |
New folders order.
|
|
#
|
public
|
createFolderByFullName(MailAccount $oAccount, string $sFolderFullNameRaw, bool $bSubscribeOnCreation = true): void
Creates a new folder using its full name in IMAP folders tree.
Creates a new folder using its full name in IMAP folders tree.
Parameters
$oAccount |
Account object.
|
$sFolderFullNameRaw |
Raw full name of the folder.
|
$bSubscribeOnCreation |
= true. If true the folder will be subscribed and thus made visible in the interface.
|
Throws
|
#
|
public
|
isExtensionSupported(MailAccount $oAccount, string $sExtensionName): bool
Checks if particular extension is supported.
Checks if particular extension is supported.
Parameters
$oAccount |
Account object.
|
$sExtensionName |
Extension name.
|
|
#
|
public
|
getFolderInformation(MailAccount $oAccount, string $sFolderFullNameRaw): array
Obtains information about particular folder.
Obtains information about particular folder.
Parameters
$oAccount |
Account object.
|
$sFolderFullNameRaw |
Raw full name of the folder.
|
Returns
array containing the following elements:
- total number of messages;
- number of unread messages;
- UIDNEXT value for the folder;
- hash string which changes its value if any of the other 3 values were changed.
|
#
|
public
|
getNewMessagesInformation(MailAccount $oAccount, string $sFolderFullNameRaw, string $sUidnext, $sNewInboxUidnext): array
Retrieves information about new message, primarily used for Inbox folder.
Retrieves information about new message, primarily used for Inbox folder.
Parameters
$oAccount |
Account object.
|
$sFolderFullNameRaw |
Raw full name of the folder.
|
$sUidnext |
UIDNEXT value used for this operation.
|
|
#
|
public
|
getMessageUIDByMessageID($oAccount, $sFolderFullNameRaw, $sUidnext, $MessageID)
|
#
|
public
|
getFolderListInformation(MailAccount $oAccount, array $aFolderFullNamesRaw, boolean $bUseListStatusIfPossible): array
Obtains information about particular folders.
Obtains information about particular folders.
Parameters
$oAccount |
Account object.
|
$aFolderFullNamesRaw |
Array containing a list of folder names to obtain information for.
|
$bUseListStatusIfPossible |
Indicates if LIST-STATUS command should be used if it's supported by IMAP server.
|
Returns
Array containing elements like those returned by getFolderInformation method.
|
#
|
public
|
createFolder(
MailAccount $oAccount,
string $sFolderNameInUtf8,
string $sDelimiter,
string $sFolderParentFullNameRaw = '',
bool $bSubscribeOnCreation = true,
): void
Creates a new folder.
Parameters
$oAccount |
Account object.
|
$sFolderNameInUtf8 |
Folder name in utf8.
|
$sDelimiter |
IMAP delimiter value.
|
$sFolderParentFullNameRaw |
= ''. Parent folder this new one is created under.
|
$bSubscribeOnCreation |
= true. If true, the folder will be subscribed and thus made visible in the interface.
|
Throws
|
#
|
public
|
deleteFolder(MailAccount $oAccount, string $sFolderFullNameRaw, bool $bUnsubscribeOnDeletion = true)
Deletes folder.
Parameters
$oAccount |
Account object.
|
$sFolderFullNameRaw |
Raw full name of the folder.
|
$bUnsubscribeOnDeletion |
= true. If true the folder will be unsubscribed along with its deletion.
|
Throws
|
#
|
public
|
renameFolder(
MailAccount $oAccount,
string $sPrevFolderFullNameRaw,
string $sNewTopFolderNameInUtf8,
bool $bChangeParent,
string $sNewParentFolder,
): string
Changes folder's name.
Parameters
$oAccount |
Account object.
|
$sPrevFolderFullNameRaw |
Raw full name of the folder.
|
$sNewTopFolderNameInUtf8 |
= ''. New name for the folder in utf8.
|
$bChangeParent |
= false
|
$sNewParentFolder |
= ''
|
Throws
|
#
|
public
|
subscribeFolder(MailAccount $oAccount, string $sFolderFullNameRaw, bool $bSubscribeAction = true)
Subscribes to IMAP folder or unsubscribes from it.
Subscribes to IMAP folder or unsubscribes from it.
Parameters
$oAccount |
Account object.
|
$sFolderFullNameRaw |
Raw full name of the folder.
|
$bSubscribeAction |
= true. If true the folder will be subscribed, otherwise unsubscribed.
|
Throws
|
#
|
public
|
clearFolder(MailAccount $oAccount, string $sFolderFullNameRaw): void
Purges all the content of a particular folder.
Purges all the content of a particular folder.
Parameters
$oAccount |
Account object.
|
$sFolderFullNameRaw |
Raw full name of the folder.
|
Throws
|
#
|
public
|
deleteMessage(MailAccount $oAccount, string $sFolderFullNameRaw, array $aUids): void
Deletes one or several messages from IMAP.
Deletes one or several messages from IMAP.
Parameters
$oAccount |
Account object.
|
$sFolderFullNameRaw |
Folder the messages are to be deleted from.
|
$aUids |
List of message UIDs.
|
Throws
|
#
|
public
|
moveMessage(MailAccount $oAccount, string $sFromFolderFullNameRaw, string $sToFolderFullNameRaw, array $aUids): void
Moves message from one folder to another.
Moves message from one folder to another.
Parameters
$oAccount |
Account object.
|
$sFromFolderFullNameRaw |
Raw full name of the source folder.
|
$sToFolderFullNameRaw |
Raw full name of the destination folder.
|
$aUids |
List of message UIDs.
|
Throws
|
#
|
public
|
copyMessage(MailAccount $oAccount, string $sFromFolderFullNameRaw, string $sToFolderFullNameRaw, array $aUids): void
Copies one or several message from one folder to another.
Copies one or several message from one folder to another.
Parameters
$oAccount |
Account object.
|
$sFromFolderFullNameRaw |
Raw full name of source folder.
|
$sToFolderFullNameRaw |
Raw full name of destination folder.
|
$aUids |
List of message UIDs.
|
Throws
|
#
|
public
|
sendMessage(
MailAccount $oAccount,
Message $oMessage,
Fetcher $oFetcher = null,
$oIdentity = null,
string $sSentFolder = '',
string $sDraftFolder = '',
string $sDraftUid = '',
array $aRecipients = [],
): array|bool
Sends message out.
Parameters
$oAccount |
Account object.
|
$oMessage |
Message to be sent out.
|
$oFetcher |
= null. Fetcher object which may override sending settings.
|
$sSentFolder |
= ''. Name of Sent folder.
|
$sDraftFolder |
= ''. Name of Sent folder.
|
$sDraftUid |
= ''. Last UID value of the message saved in Drafts folder.
|
$aRecipients |
Recipients that will be used to send messages through the SMTP. Use this parameter if you want real recipients to differ from those specified in the message body (To, CC, BCC).
|
Throws
|
#
|
public
|
saveMessage(MailAccount $oAccount, Message $oMessage, string $sDraftFolder, string $sDraftUid = ''): array|bool
Saves message to a specific folder. The method is primarily used for saving drafts.
Saves message to a specific folder. The method is primarily used for saving drafts.
Parameters
$oAccount |
Account object.
|
$oMessage |
Object representing message to be saved.
|
$sDraftFolder |
Folder the message is saved to.
|
$sDraftUid |
= ''. UID of the message to be replaced; saving new draft removes the previous version.
|
Returns
Array containing name of the folder and UID of the message stored, or bool in case of failure.
Throws
|
#
|
public
|
appendMessageFromFile(MailAccount $oAccount, string $sMessageFileName, string $sFolderToAppend): void
Appends message from file to a specific folder.
Appends message from file to a specific folder.
Parameters
$oAccount |
Account object.
|
$sMessageFileName |
Path to .eml file.
|
$sFolderToAppend |
Folder the message is appended to.
|
|
#
|
public
|
appendMessageFromStream(
MailAccount $oAccount,
resource $rMessage,
string $sFolder,
int $iStreamSize,
int &$iUid = null,
): void
Appends message from stream to a specific folder.
Appends message from stream to a specific folder.
Parameters
$oAccount |
Account object.
|
$rMessage |
Resource the message is appended from.
|
$sFolder |
Folder the message is appended to.
|
$iStreamSize |
Size of stream.
|
|
#
|
public
|
setMessageFlag(
MailAccount $oAccount,
string $sFolderFullNameRaw,
array $aUids,
string $sFlagString,
int $iAction = MessageStoreAction::Add,
bool $bSetToAll = false,
bool $bSkipNonPermanentsFlags = false,
): true
Sets, removes or toggles flags of one or several messages.
Sets, removes or toggles flags of one or several messages.
Parameters
$oAccount |
Account object.
|
$sFolderFullNameRaw |
Raw full name of the folder.
|
$aUids |
List of message UIDs .
|
$sFlagString |
String holding a list of flags to be modified.
|
$iAction |
= \Aurora\Modules\Mail\Enums\MessageStoreAction::Add. Flag triggering mode.
|
$bSetToAll |
= false. If true flags will be applied to all messages in folder.
|
$bSkipNonPermanentsFlags |
= false. If true flags wich is not permanent will be skipped.
|
Throws
|
#
|
public
|
getMessageUid(MailAccount $oAccount, string $sFolderName, string $sMessageId): int|null
Searches for a message with a specific Message-ID value and returns it's uid.
Searches for a message with a specific Message-ID value and returns it's uid.
Parameters
$oAccount |
Account object.
|
$sFolderName |
Name of the folder to look for message in.
|
$sMessageId |
Message-ID value of the message.
|
Returns
Integer message UID if the message was found, null otherwise.
|
#
|
public
|
getUnifiedMailboxMessagesInfo(
$oAccount,
$sFolderName,
$sSearch = '',
$aFilters = [],
$bUseThreading = false,
$Limit = 20,
$sSortBy = 'ARRIVAL',
$sSortOrder = 'REVERSE',
)
|
#
|
public
|
getMessagesInfo($oAccount, $sFolderName, $Search, $bUseThreading = false, $sSortBy = 'ARRIVAL', $sSortOrder = 'REVERSE')
|
#
|
public
|
getQuota(MailAccount $oAccount): array|bool
Retrieves quota information for the account.
Retrieves quota information for the account.
Parameters
$oAccount |
Account object.
|
Returns
Array of quota values or bool if the information is unavailable.
|
#
|
public
|
directMessageToStream(
MailAccount $oAccount,
mixed $mCallback,
string $sFolderName,
int $iUid,
string $sMimeIndex = '',
): bool
This is universal function for obtaining any MIME data via stream.
This is universal function for obtaining any MIME data via stream.
Parameters
$oAccount |
Account object.
|
$mCallback |
This callback accepts the following parameters: $rMessageMimeIndexStream, $sContentType, $sFileName, $sMimeIndex.
|
$sFolderName |
Folder the message resides in.
|
$iUid |
UID of the message we're working with.
|
$sMimeIndex |
= ''. Mime index of message part.
|
Throws
|
#
|
public
|
_sortHelper(type $a, type $b, type $aSortUidsFlipped): int
Compares items for sorting.
Compares items for sorting.
Parameters
$a |
First item to compare.
|
$b |
Second item to compare.
|
$aSortUidsFlipped |
Array contains items to compare.
|
|
#
|
public
|
getMessage(MailAccount $oAccount, string $sFolderName, int $iIndex, bool $bIndexIsUid = true): Message|false
Parameters
$oAccount |
Account object.
|
$bIndexIsUid |
= true
|
Throws
|
#
|
public
|
getMessageList(
MailAccount $oAccount,
string $sFolderFullNameRaw,
int $iOffset = 0,
int $iLimit = 20,
string $sSearch = '',
bool $bUseThreading = false,
array $aFilters = [],
string $sInboxUidnext = '',
$sSortBy = 'ARRIVAL',
$sSortOrder = 'REVERSE',
): MessageCollection
Obtains message list with messages data.
Obtains message list with messages data.
Parameters
$oAccount |
Account object.
|
$sFolderFullNameRaw |
Raw full name of the folder.
|
$iOffset |
= 0. Offset value for obtaining a partial list.
|
$iLimit |
= 20. Limit value for obtaining a partial list.
|
$sSearch |
= ''. Search text.
|
$bUseThreading |
= false. If true, message list will be returned in threaded mode.
|
$aFilters |
= array(). Contains filters for searching of messages.
|
$sInboxUidnext |
= ''. Uidnext value of Inbox folder.
|
Throws
|
#
|
public
|
getMessageListByUids(
MailAccount $oAccount,
string $sFolderFullNameRaw,
array $aUids,
$sInboxUidnext = '',
): MessageCollection
Obtains a list of specific messages.
Obtains a list of specific messages.
Parameters
$oAccount |
Account object.
|
$sFolderFullNameRaw |
Raw full name of the folder.
|
$aUids |
List of message UIDs.
|
Throws
|
#
|
public
|
getMessagesFlags(MailAccount $oAccount, string $sFolderFullNameRaw, array $aUids): MessageCollection
Obtains list of flags for one or several messages.
Obtains list of flags for one or several messages.
Parameters
$oAccount |
Account object.
|
$sFolderFullNameRaw |
Raw full name of the folder.
|
$aUids |
List of message UIDs.
|
Throws
|
#
|