class Mailbox implements MailboxInterface (View source)

Properties

protected array $config

The mailbox configuration.

protected array|null $capabilities

The cached mailbox capabilities.

protected FolderInterface|null $selected

The currently selected folder.

protected ConnectionInterface|null $connection

The mailbox connection.

Methods

__construct(array $config = [])

Constructor.

void
__clone()

Prepare the cloned instance.

static Mailbox
make(array $config = [])

Make a new mailbox instance.

mixed
config(string|null $key = null, mixed $default = null)

Get mailbox configuration values.

connection()

Get the mailbox connection.

bool
connected()

Determine if connection was established.

void
reconnect()

Force a reconnection to the server.

void
connect(ConnectionInterface|null $connection = null)

Connect to the server.

void
authenticate()

Authenticate the current session.

void
disconnect()

Disconnect from server.

inbox()

Get the mailbox's inbox folder.

folders()

Begin querying for mailbox folders.

array
capabilities()

Get the mailbox's capabilities.

void
select(FolderInterface $folder, bool $force = false)

Select the given folder.

bool
selected(FolderInterface $folder)

Determine if the given folder is selected.

Details

__construct(array $config = [])

Constructor.

Parameters

array $config

void __clone()

Prepare the cloned instance.

Return Value

void

static Mailbox make(array $config = [])

Make a new mailbox instance.

Parameters

array $config

Return Value

Mailbox

mixed config(string|null $key = null, mixed $default = null)

Get mailbox configuration values.

Parameters

string|null $key
mixed $default

Return Value

mixed

ConnectionInterface connection()

Get the mailbox connection.

Return Value

ConnectionInterface

bool connected()

Determine if connection was established.

Return Value

bool

void reconnect()

Force a reconnection to the server.

Return Value

void

void connect(ConnectionInterface|null $connection = null)

Connect to the server.

Parameters

ConnectionInterface|null $connection

Return Value

void

protected void authenticate()

Authenticate the current session.

Return Value

void

void disconnect()

Disconnect from server.

Return Value

void

FolderInterface inbox()

Get the mailbox's inbox folder.

Return Value

FolderInterface

FolderRepositoryInterface folders()

Begin querying for mailbox folders.

array capabilities()

Get the mailbox's capabilities.

Return Value

array

void select(FolderInterface $folder, bool $force = false)

Select the given folder.

Parameters

FolderInterface $folder
bool $force

Return Value

void

bool selected(FolderInterface $folder)

Determine if the given folder is selected.

Parameters

FolderInterface $folder

Return Value

bool