CRM_Mailing_MailStore_Imap
extends CRM_Mailing_MailStore
in package
Class CRM_Mailing_MailStore_Imap
Table of Contents
Properties
- $_debug : bool
- Flag to decide whether to print debug messages
- $_transport : ezcMailImapTransport|ezcMailMboxTransport|ezcMailPop3Transport|null
- Holds the underlying mailbox transport implementation
- $_ignored : string
- Path to a IMAP directory to store ignored emails
- $_processed : string
- Path to a IMAP directory to store ignored emails
Methods
- __construct() : CRM_Mailing_MailStore_Imap
- Connect to the supplied IMAP server and make sure the two mailboxes exist.
- allMails() : array<string|int, mixed>
- Return all emails in the mail store.
- expunge() : mixed
- Expunge the messages marked for deletion, CRM-7356
- fetchNext() : array<string|int, mixed>
- Return the next X messages from the mail store.
- getStore() : CRM_Mailing_MailStore
- Return the proper mail store implementation, based on config settings.
- maildir() : string
- Point to (and create if needed) a local Maildir for storing retrieved mail
- markIgnored() : mixed
- Move the specified message to the ignored folder.
- markProcessed() : mixed
- Move the specified message to the processed folder.
- getProtocolDefaults() : array<string|int, mixed>
Properties
$_debug
Flag to decide whether to print debug messages
public
bool
$_debug
= \FALSE
$_transport
Holds the underlying mailbox transport implementation
protected
ezcMailImapTransport|ezcMailMboxTransport|ezcMailPop3Transport|null
$_transport
$_ignored
Path to a IMAP directory to store ignored emails
private
string
$_ignored
$_processed
Path to a IMAP directory to store ignored emails
private
string
$_processed
Methods
__construct()
Connect to the supplied IMAP server and make sure the two mailboxes exist.
public
__construct(string $host, string $username, string $password[, bool $ssl = TRUE ][, string $folder = 'INBOX' ][, bool $useXOAUTH2 = FALSE ]) : CRM_Mailing_MailStore_Imap
Parameters
- $host : string
-
Host to connect to.
- $username : string
-
Authentication username.
- $password : string
-
Authentication password.
- $ssl : bool = TRUE
-
Whether to use IMAP or IMAPS.
- $folder : string = 'INBOX'
-
Name of the inbox folder.
- $useXOAUTH2 : bool = FALSE
-
Use XOAUTH2 authentication method
Return values
CRM_Mailing_MailStore_ImapallMails()
Return all emails in the mail store.
public
allMails() : array<string|int, mixed>
Return values
array<string|int, mixed> —array of ezcMail objects
expunge()
Expunge the messages marked for deletion, CRM-7356
public
expunge() : mixed
fetchNext()
Return the next X messages from the mail store.
public
fetchNext([int $count = 1 ]) : array<string|int, mixed>
Parameters
- $count : int = 1
-
Number of messages to fetch (0 to fetch all).
Return values
array<string|int, mixed> —array of ezcMail objects
getStore()
Return the proper mail store implementation, based on config settings.
public
static getStore([string $name = NULL ]) : CRM_Mailing_MailStore
Parameters
- $name : string = NULL
-
Name of the settings set from civimail_mail_settings to use (null for default).
Tags
Return values
CRM_Mailing_MailStore —mail store implementation for processing CiviMail-bound emails
maildir()
Point to (and create if needed) a local Maildir for storing retrieved mail
public
maildir(string $name) : string
Parameters
- $name : string
-
Name of the Maildir.
Tags
Return values
string —path to the Maildir's cur directory
markIgnored()
Move the specified message to the ignored folder.
public
markIgnored(int $nr) : mixed
Parameters
- $nr : int
-
Number of the message to move.
markProcessed()
Move the specified message to the processed folder.
public
markProcessed(int $nr) : mixed
Parameters
- $nr : int
-
Number of the message to move.
getProtocolDefaults()
private
static getProtocolDefaults(string $protocol) : array<string|int, mixed>
Parameters
- $protocol : string
-
Ex: 'IMAP', 'Maildir'
Return values
array<string|int, mixed> —List of properties to merge into the $mailSettings. The most important property is 'factory' with signature:
function($mailSettings): CRM_Mailing_MailStore