Documentation

IMP_Api extends Horde_Registry_Api
in package

IMP external API interface.

This file defines IMP's external API interface. Other applications can interact with IMP through this API.

Tags
author

Michael Slusarz slusarz@horde.org

category

Horde

copyright

2009-2017 Horde LLC

license

http://www.horde.org/licenses/gpl GPL

Table of Contents

Properties

$_noPerms  : array<string|int, mixed>
The listing of API calls that do not require permissions checking.

Methods

addFlags()  : mixed
Ensures a list of user-defined IMAP flag(s) for the current user exist.
batchCompose()  : array<string|int, mixed>
Return a list of compose window links.
compose()  : Horde_Url
Returns a compose window link.
copyMessages()  : bool
Copies messages to a mailbox.
createMailbox()  : Horde_Imap_Client_Mailbox
Creates a new mailbox.
deleteMessages()  : int|bool
Deletes messages from a mailbox.
favouriteRecipients()  : array<string|int, mixed>
Returns the list of favorite recipients.
flagList()  : array<string|int, mixed>
Return the list of user-settable IMAP flags.
flagMessages()  : bool
Flag messages.
getMaillog()  : Horde_History_Log
Obtain the Maillog for a given message.
getMaillogChanges()  : array<string|int, mixed>
Returns a list of Message-IDs that have been added to the Maillog since the specified timestamp.
getSpecialMailboxes()  : mixed
Return the list of special mailboxes.
imapOb()  : Horde_Imap_Client_Base
Returns the Horde_Imap_Client object created using the IMP credentials.
logMaillog()  : mixed
Log an entry in the Maillog.
logRecipient()  : mixed
Log an entry to the IMP_Sentmail system.
mailboxList()  : array<string|int, mixed>
Returns the list of mailboxes.
mdnSend()  : bool
Check if we need to send a MDN, and send if needed/able. Will only send MDN if the request does NOT need to be confirmed by the user.
moveMessages()  : bool
Moves messages to a mailbox.
searchMailbox()  : array<string|int, mixed>
Perform a search query on the remote IMAP server.
server()  : mixed
Returns information on the currently logged on IMAP server.

Properties

$_noPerms

The listing of API calls that do not require permissions checking.

protected array<string|int, mixed> $_noPerms = array('compose', 'batchCompose')

Methods

addFlags()

Ensures a list of user-defined IMAP flag(s) for the current user exist.

public addFlags(array<string|int, mixed> $flags) : mixed

Silently ignores any flags that are already defined.

Parameters
$flags : array<string|int, mixed>

An array of user-defined flag names.

batchCompose()

Return a list of compose window links.

public batchCompose([string|array<string|int, mixed> $args = array() ][, array<string|int, mixed> $extra = array() ]) : array<string|int, mixed>
Parameters
$args : string|array<string|int, mixed> = array()

List of arguments to pass to compose page. If this is passed in as a string, it will be parsed as a toaddress?subject=foo&cc=ccaddress (mailto-style) string.

$extra : array<string|int, mixed> = array()

List of hashes of extra, non-standard arguments to pass to compose page.

Return values
array<string|int, mixed>

The list of Horde_Url objects with links to the message composition screen.

compose()

Returns a compose window link.

public compose([string|array<string|int, mixed> $args = array() ][, array<string|int, mixed> $extra = array() ]) : Horde_Url
Parameters
$args : string|array<string|int, mixed> = array()

List of arguments to pass to compose page. If this is passed in as a string, it will be parsed as a toaddress?subject=foo&cc=ccaddress (mailto-style) string.

$extra : array<string|int, mixed> = array()

Hash of extra, non-standard arguments to pass to compose page.

Return values
Horde_Url

The link to the message composition screen.

copyMessages()

Copies messages to a mailbox.

public copyMessages(string $mailbox, array<string|int, mixed> $indices, string $target) : bool
Parameters
$mailbox : string

The name of the source mailbox (UTF-8).

$indices : array<string|int, mixed>

The list of UIDs to copy.

$target : string

The name of the target mailbox (UTF-8).

Return values
bool

True if successful, false if not.

createMailbox()

Creates a new mailbox.

public createMailbox(string $mbox[, array<string|int, mixed> $options = array() ]) : Horde_Imap_Client_Mailbox
Parameters
$mbox : string

The name of the mailbox to create (UTF-8).

$options : array<string|int, mixed> = array()

Additional options:

  • full: (boolean) If true, $mbox is a full mailbox name. If false, $mbox will be created in the default namespace. DEFAULT: false
Tags
throws
IMP_Exception
Return values
Horde_Imap_Client_Mailbox

The mailbox name created or false on failure.

deleteMessages()

Deletes messages from a mailbox.

public deleteMessages(string $mailbox, array<string|int, mixed> $indices) : int|bool
Parameters
$mailbox : string

The name of the mailbox (UTF-8).

$indices : array<string|int, mixed>

The list of UIDs to delete.

Return values
int|bool

The number of messages deleted if successful, false if not.

favouriteRecipients()

Returns the list of favorite recipients.

public favouriteRecipients(int $limit[, array<string|int, mixed> $filter = array('new', 'forward', 'reply', 'redirect') ]) : array<string|int, mixed>
Parameters
$limit : int

Return this number of recipients.

$filter : array<string|int, mixed> = array('new', 'forward', 'reply', 'redirect')

A list of messages types that should be returned. Valid types: 'forward', 'mdn', 'new', 'reply', and 'redirect'. A value of null returns all message types.

Tags
throws
IMP_Exception
Return values
array<string|int, mixed>

A list with the $limit most favourite recipients.

flagList()

Return the list of user-settable IMAP flags.

public flagList([string $mailbox = null ]) : array<string|int, mixed>
Parameters
$mailbox : string = null

If set, returns the list of flags filtered by what the mailbox allows (UTF-8).

Return values
array<string|int, mixed>

A list of IMP_Flag_Base objects.

flagMessages()

Flag messages.

public flagMessages(string $mailbox, array<string|int, mixed> $indices, array<string|int, mixed> $flags, bool $set) : bool
Parameters
$mailbox : string

The name of the source mailbox (UTF-8).

$indices : array<string|int, mixed>

The list of UIDs to flag.

$flags : array<string|int, mixed>

The flags to set.

$set : bool

True to set flags, false to clear flags.

Return values
bool

True if successful, false if not.

getMaillog()

Obtain the Maillog for a given message.

public getMaillog(string $mid) : Horde_History_Log
Parameters
$mid : string

The Message-ID to obtain the log for.

Tags
todo

This should not be returning a Horde_History_Log object.

Return values
Horde_History_Log

The log object.

getMaillogChanges()

Returns a list of Message-IDs that have been added to the Maillog since the specified timestamp.

public getMaillogChanges(int $ts) : array<string|int, mixed>
Parameters
$ts : int

The timestamp to start searching from. Only entries after this timestamp will be returned.

Tags
todo

This should not be returning Message-IDs.

Return values
array<string|int, mixed>

An array of Message-IDs that have been changed since $ts.

getSpecialMailboxes()

Return the list of special mailboxes.

public getSpecialMailboxes() : mixed
Tags
@return

@see IMP_Mailbox::getSpecialMailboxes()

imapOb()

Returns the Horde_Imap_Client object created using the IMP credentials.

public imapOb() : Horde_Imap_Client_Base
Return values
Horde_Imap_Client_Base

The imap object.

logMaillog()

Log an entry in the Maillog.

public logMaillog(string $action, string $mid[, string $data = null ]) : mixed
Parameters
$action : string

The action to log.

$mid : string

The Message-ID.

$data : string = null

Additional data.

Tags
todo

Rewrite this. $action and $data are both IMP specific, so they aren't intended to be set from outside of IMP. And $mid should be replaced by mailbox/UID.

logRecipient()

Log an entry to the IMP_Sentmail system.

public logRecipient(mixed $reason, string|array<string|int, mixed> $recipients, string $message_id[, bool $success = true ]) : mixed
Parameters
$reason : mixed
$recipients : string|array<string|int, mixed>

The message recipients.

$message_id : string

The Message-ID.

$success : bool = true

Was the message successfully sent?

mailboxList()

Returns the list of mailboxes.

public mailboxList([array<string|int, mixed> $opts = array() ]) : array<string|int, mixed>
Parameters
$opts : array<string|int, mixed> = array()

Additional options:

  - unsub: (boolean)  If true, return unsubscribed mailboxes.
  - reload: (boolean) If true, force reloading the folder tree from
                      the IMAP server. DEFAULT: false
Return values
array<string|int, mixed>

The list of IMAP mailboxes. A list of arrays with the following keys:

  - d: (string) The namespace delimiter.
  - label: (string) Human readable label (UTF-8).
  - level: (integer) The child level of this element.
  - ob: (Horde_Imap_Client_Mailbox) A mailbox object.
  - subscribed: (boolean) True if mailbox is subscribed.

mdnSend()

Check if we need to send a MDN, and send if needed/able. Will only send MDN if the request does NOT need to be confirmed by the user.

public mdnSend(Horde_Mime_Headers $headers, mixed $mailbox, mixed $uid) : bool
Parameters
$headers : Horde_Mime_Headers

The headers of the message.

$mailbox : mixed
$uid : mixed
Return values
bool

True if the MDN request was able to be sent.

moveMessages()

Moves messages to a mailbox.

public moveMessages(string $mailbox, array<string|int, mixed> $indices, string $target) : bool
Parameters
$mailbox : string

The name of the source mailbox (UTF-8).

$indices : array<string|int, mixed>

The list of UIDs to move.

$target : string

The name of the target mailbox (UTF-8).

Return values
bool

True if successful, false if not.

searchMailbox()

Perform a search query on the remote IMAP server.

public searchMailbox(string $mailbox, Horde_Imap_Client_Search_Query $query) : array<string|int, mixed>
Parameters
$mailbox : string

The name of the source mailbox (UTF-8).

$query : Horde_Imap_Client_Search_Query

The query object.

Return values
array<string|int, mixed>

The search results (UID list).

server()

Returns information on the currently logged on IMAP server.

public server() : mixed
Return values
mixed

An array with the following entries:

  • hostspec: (string) The server hostname.
  • port: (integer) The server port.
  • protocol: (string) Either 'imap' or 'pop'.
  • secure: (string) Either 'none', 'ssl', or 'tls'.

        
On this page

Search results