php-doc-en/functions/imap.sgml
Sascha Schumann ec1ea24811 taken from php3/doc on 19990606
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@9477 c90b9560-bf6c-de11-be94-00142212c4b1
1999-06-06 18:51:02 +00:00

1065 lines
34 KiB
Text

<reference id="ref.imap">
<title>IMAP Functions</title>
<titleabbrev>IMAP</titleabbrev>
<partintro>
<simpara>
To get these functions to work, you have to compile PHP with
--with-imap. That requires the c-client library to be
installed. Grab the latest version from <ulink
url="ftp://ftp.cac.washington.edu/imap/">ftp://ftp.cac.washington.edu/imap/</ulink>
and compile it. Then copy c-client/c-client.a to /usr/local/lib or
some other directory on your link path and copy c-client/rfc822.h,
mail.h and linkage.h to /usr/local/include or some other directory
in your include path.
</partintro>
<refentry id="function.imap-append">
<refnamediv>
<refname>imap_append</refname>
<refpurpose>Append a string message to a specified mailbox</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>imap_append</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>string <parameter>mbox</parameter></paramdef>
<paramdef>string <parameter>message</parameter></paramdef>
<paramdef>string<parameter>flags</parameter></paramdef>
</funcsynopsis>
<para>
Returns true on sucess, false on error.
<para>
<function>imap_append</function> appends a string message to the
specified mailbox <parameter>mbox</parameter>. If the optional
<parameter>flags</parameter> is specified, writes the
<parameter>flags</parameter> to that mailbox also.
<para>
When talking to the Cyrus IMAP server, you must use "\r\n" as
your end-of-line terminator instead of "\n" or the operation will
fail.
</refsect1>
</refentry>
<refentry id="function.imap-base64">
<refnamediv>
<refname>imap_base64</refname>
<refpurpose>Decode BASE64 encoded text</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>string <function>imap_base64</function></funcdef>
<paramdef>string <parameter>text</parameter></paramdef>
</funcsynopsis>
<para>
<function>imap_base64</function> function decodes BASE-64 encoded
text. The decoded message is returned as a string.
</refsect1>
</refentry>
<refentry id="function.imap-body">
<refnamediv>
<refname>imap_body</refname>
<refpurpose>Read the message body</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>string <function>imap_body</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>int <parameter>msg_number</parameter></paramdef>
<paramdef>int <parameter>flags</parameter></paramdef>
</funcsynopsis>
<para>
<function>imap_body</function> returns the body of the message,
numbered <parameter> msg_number</parameter> in the current
mailbox. The optional <parameter>flags</parameter> are a bit mask
with one or more of the following:
<itemizedlist>
<listitem><simpara>
FT_UID - The msgno is a UID
<listitem><simpara>
FT_PEEK - Do not set the \Seen flag if not already set
<listitem><simpara>
FT_INTERNAL - The return string is in internal format, will
not canonicalize to CRLF.
</itemizedlist>
</refsect1>
</refentry>
<refentry id="function.imap-check">
<refnamediv>
<refname>imap_check</refname>
<refpurpose>Check current mailbox</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>array <function>imap_check</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
</funcsynopsis>
<para>
Returns information about the current mailbox. Returns FALSE on
failure.
<para>
The <function>imap_check</function> function checks the current
mailbox status on the server and returns the information in an
object with following properties.
<para>
<informalexample>
<literallayout>
Date : date of the message
Driver : driver
Mailbox : name of the mailbox
Nmsgs : number of messages
Recent : number of recent messages
</literallayout>
</informalexample>
</refsect1>
</refentry>
<refentry id="function.imap-close">
<refnamediv>
<refname>imap_close</refname>
<refpurpose>Close an IMAP stream</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>imap_close</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>int <parameter>flags</parameter></paramdef>
</funcsynopsis>
<para>
Close the imap stream. Takes an optional
<parameter>flag</parameter> CL_EXPUNGE, which will silently
expunge the mailbox before closing.
</refsect1>
</refentry>
<refentry id="function.imap-createmailbox">
<refnamediv>
<refname>imap_createmailbox</refname>
<refpurpose>Create a new mailbox</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>imap_createmailbox</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>string <parameter>mbox</parameter></paramdef>
</funcsynopsis>
<para>
<function>imap_createmailbox</function> creates a new mailbox
specified by <parameter>mbox</parameter>.
<para>
Returns true on success and false on error.
</refsect1>
</refentry>
<refentry id="function.imap-delete">
<refnamediv>
<refname>imap_delete</refname>
<refpurpose>Mark a messge for deletion from current mailbox</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>imap_delete</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>int <parameter>msg_number</parameter></paramdef>
</funcsynopsis>
<para>
Returns true.
<para>
<function>imap_delete</function> function marks message pointed
by <parameter>msg_number</parameter> for deletion. Actual
deletion of the messages is done by
<function>imap_expunge</function>.
</refsect1>
</refentry>
<refentry id="function.imap-deletemailbox">
<refnamediv>
<refname>imap_deletemailbox</refname>
<refpurpose>Delete a mailbox</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>imap_deletemailbox</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>string <parameter>mbox</parameter></paramdef>
</funcsynopsis>
<para>
<function>imap_deletemailbox</function> deletes the specified
mailbox.
<para>
Returns true on success and false on error.
</refsect1>
</refentry>
<refentry id="function.imap-expunge">
<refnamediv>
<refname>imap_expunge</refname>
<refpurpose>Delete all messages marked for deletion</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>imap_expunge</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
</funcsynopsis>
<para>
<function>imap_expunge</function> deletes all the messages marked
for deletion by <function>imap_delete</function>.
<para>
Returns true.
</refsect1>
</refentry>
<refentry id="function.imap-fetchbody">
<refnamediv>
<refname>imap_fetchbody</refname>
<refpurpose>Fetch a particular section of the body of the
message</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>string <function>imap_fetchbody</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>int <parameter>msg_number</parameter></paramdef>
<paramdef>string <parameter>part_number</parameter></paramdef>
<paramdef>flags <parameter>flags</parameter></paramdef>
</funcsynopsis>
<para>
This function causes a fetch of a particular section of the body
of the specified messages as a text string and returns that text
string. The section specification is a string of integers
delimited by period which index into a body part list as per the
IMAP4 specification. Body parts are not decoded by this function.
<para>
The options for <function>imap_fetchbody </function>e a bitmask
with one or more of the following
<itemizedlist>
<listitem><simpara>
FT_UID - The msgono is a UID
<listitem><simpara>
FT_PEEK - Do not set the \Seen flag if not already set
<listitem><simpara>
FT_UID - The return string is in "internal" format, without
any attempt to canonicalize CRLF
</itemizedlist>
</refsect1>
</refentry>
<refentry id="function.imap-fetchstructure">
<refnamediv>
<refname>imap_fetchstructure</refname>
<refpurpose>Read the structure of a particular message</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>array <function>imap_fetchstructure</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>int <parameter>msg_number</parameter></paramdef>
</funcsynopsis>
<para>
This function causes a fetch of all the structured information
for the given <parameter>msg_number</parameter>. The returned
value is an object with following elements.
<para>
<informalexample>
<literallayout>
type, encoding, ifsubtype, subtype, ifdescription, description, ifid,
id, lines, bytes, ifparameters
</literallayout>
</informalexample>
<para>
It also returns an array of objects called parameters[]. This
object has following properties.
<informalexample>
<literallayout>
attribute, value
</literallayout>
</informalexample>
In case of multipart, it also returns an array of objects of all
the properties, called parts[].
</refsect1>
</refentry>
<refentry id="function.imap-header">
<refnamediv>
<refname>imap_header</refname>
<refpurpose>Read the header of the message</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>object <function>imap_header</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>int <parameter>msg_number</parameter></paramdef>
<paramdef>int <parameter>fromlength</parameter></paramdef>
<paramdef>int <parameter>subjectlength</parameter></paramdef>
<paramdef>int <parameter>defaulthost</parameter></paramdef>
</funcsynopsis>
<para>
This function returns an object of various header elements
<para>
<informalexample>
<literallayout>
remail,date,Date,subject,Subject,in_reply_to,message_id,newsgroups,
followup_to,references
toaddress (full to: line, up to 1024 characters)
to[] (returns an array of objects from the To line, containing:)
personal
adl
mailbox
host
fromaddress (full from: line, up to 1024 characters)
from[] (returns an array of objects from the From line, containing:)
personal
adl
mailbox
host
ccaddress (full cc: line, up to 1024 characters)
cc[] (returns an array of objects from the Cc line, containing:)
personal
adl
mailbox
host
bccaddress (full bcc line, up to 1024 characters)
bcc[] (returns an array of objects from the Bcc line, containing:)
personal
adl
mailbox
host
reply_toaddress (full reply_to: line, up to 1024 characters)
reply_to[] (returns an array of objects from the Reply_to line, containing:)
personal
adl
mailbox
host
senderaddress (full sender: line, up to 1024 characters)
sender[] (returns an array of objects from the sender line, containing:)
personal
adl
mailbox
host
return_path (full return-path: line, up to 1024 characters)
return_path[] (returns an array of objects from the return_path line, containing:)
personal
adl
mailbox
host
udate ( mail message date in unix time)
fetchfrom (from line formatted to fit <parameter>fromlength</parameter> characters)
fetchsubject (subject line formatted to fit <parameter>subjectlength</parameter> characters)
</literallayout>
</informalexample>
</refsect1>
</refentry>
<refentry id="function.imap-headers">
<refnamediv>
<refname>imap_headers</refname>
<refpurpose>Returns headers for all messages in a mailbox</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>array <function>imap_headers</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
</funcsynopsis>
<para>
Returns an array of string formatted with header info. One
element per mail message.
</refsect1>
</refentry>
<refentry id="function.imap-listmailbox">
<refnamediv>
<refname>imap_listmailbox</refname>
<refpurpose>Read the list of mailboxes</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>array <function>imap_listmailbox</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>string <parameter>ref</parameter></paramdef>
<paramdef>string <parameter>pat</parameter></paramdef>
</funcsynopsis>
<para>
Returns an array containing the names of the mailboxes.
</refsect1>
</refentry>
<refentry id="function.imap-listsubscribed">
<refnamediv>
<refname>imap_listsubscribed</refname>
<refpurpose>List all the subscribed mailboxes</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>array <function>imap_listsubscribed</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>string <parameter>ref</parameter></paramdef>
<paramdef>string <parameter>pattern</parameter></paramdef>
</funcsynopsis>
<para>
Returns an array of all the mailboxes that you have
subscribed. The <parameter>ref</parameter> and
<parameter>pattern</parameter> arguments specify the base
location to search from and the pattern the mailbox name must
match.
</refsect1>
</refentry>
<refentry id="function.imap-mail-copy">
<refnamediv>
<refname>imap_mail_copy</refname>
<refpurpose>Copy specified messages to a mailbox</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>imap_mail_copy</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>string <parameter>msglist</parameter></paramdef>
<paramdef>string <parameter>mbox</parameter></paramdef>
<paramdef>int <parameter>flags</parameter></paramdef>
</funcsynopsis>
<para>
Returns true on success and false on error.
<para>
Copies mail messages specified by <parameter>msglist</parameter>
to specified mailbox. <parameter>msglist</parameter> is a range
not just message numbers.
<para>
flags is a bitmask of one or more of
<itemizedlist>
<listitem><simpara>
CP_UID - the sequence numbers contain UIDS
<listitem><simpara>
CP_MOVE - Delete the messages from the current mailbox after
copying
</itemizedlist>
</refsect1>
</refentry>
<refentry id="function.imap-mail-move">
<refnamediv>
<refname>imap_mail_move</refname>
<refpurpose>Move specified messages to a mailbox</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>imap_mail_move</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>string <parameter>msglist</parameter></paramdef>
<paramdef>string <parameter>mbox</parameter></paramdef>
</funcsynopsis>
<para>
Moves mail messages specified by <parameter>msglist</parameter>
to specified mailbox. <parameter>msglist</parameter> is a range
not just message numbers.
<para>
Returns true on success and false on error.
</refsect1>
</refentry>
<refentry id="function.imap-num-msg">
<refnamediv>
<refname>imap_num_msg</refname>
<refpurpose>Gives the number of messages in the current
mailbox</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>imap_num_msg</function></funcdef>
<paramdef>int <parameter>stream_id</parameter></paramdef>
</funcsynopsis>
<para>
Return the number of messages in the current mailbox.
</refsect1>
</refentry>
<refentry id="function.imap-num-recent">
<refnamediv>
<refname>imap_num_recent</refname>
<refpurpose>Gives the number of recent messages in current
mailbox</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>imap_num_recent</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
</funcsynopsis>
<para>
Returns the number of recent messages in the current mailbox.
<para>
</refsect1>
</refentry>
<refentry id="function.imap-open">
<refnamediv>
<refname>imap_open</refname>
<refpurpose>Open an IMAP stream to a mailbox</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>imap_open</function></funcdef>
<paramdef>string <parameter>mailbox</parameter></paramdef>
<paramdef>string <parameter>username</parameter></paramdef>
<paramdef>string <parameter>password</parameter></paramdef>
<paramdef>int <parameter>flags</parameter></paramdef>
</funcsynopsis>
<para>
Returns an IMAP stream on success and false on error. This
function can also be used to open streams to POP3 and NNTP
servers. To connect to an IMAP server running on port 143 on the
local machine, do the following:
<informalexample>
<programlisting role=php>
$mbox = imap_open("{localhost:143}INBOX","user_id","password");
</programlisting>
</informalexample>
To connect to a POP3 server on port 110 on the local server, use:
<informalexample>
<programlisting>
$mbox = imap_open("{localhost/pop3:110}INBOX","user_id","password");
</programlisting>
</informalexample>
To connect to an NNTP server on port 119 on the local server, use:
<informalexample>
<programlisting>
$nntp = imap_open("{localhost/nntp:119}comp.test","","");
</programlisting>
</informalexample>
To connect to a remote server replace "localhost" with the name
or the IP address of the server you want to connect to.
<para>
The options are a bit mask with one or more of the following:
<itemizedlist>
<listitem><simpara>
OP_READONLY - Open mailbox read-only
<listitem><simpara>
OP_ANONYMOUS - Dont use or update a .newsrc for news
<listitem><simpara>
OP_HALFOPEN - For IMAP and NNTP names, open a connection but
dont open a mailbox
<listitem><simpara>
CL_EXPUNGE - Expunge mailbox automatically upon mailbox close
</itemizedlist>
</refsect1>
</refentry>
<refentry id="function.imap-ping">
<refnamediv>
<refname>imap_ping</refname>
<refpurpose>Check if the IMAP stream is still active</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>imap_ping</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
</funcsynopsis>
<para>
Returns true if the stream is still alive, false otherwise.
<para>
<function>imap_ping</function> function pings the stream to see
it is still active. It may discover new mail; this is the
preferred method for a periodic "new mail check" as well as a
"keep alive" for servers which have inactivity timeout.
</refsect1>
</refentry>
<refentry id="function.imap-renamemailbox">
<refnamediv>
<refname>imap_renamemailbox</refname>
<refpurpose>Rename an old mailbox to new mailbox</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>imap_renamemailbox</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>string <parameter>old_mbox</parameter></paramdef>
<paramdef>string <parameter>new_mbox</parameter></paramdef>
</funcsynopsis>
<para>
This function renames on old mailbox to new mailbox.
<para>
Returns true on success and false on error.
</refsect1>
</refentry>
<refentry id="function.imap-reopen">
<refnamediv>
<refname>imap_reopen</refname>
<refpurpose>Reopen IMAP stream to new mailbox</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>imap_reopen</function></funcdef>
<paramdef>string <parameter>imap_stream</parameter></paramdef>
<paramdef>string <parameter>mailbox</parameter></paramdef>
<paramdef>string
<parameter><optional>flags</optional></parameter></paramdef>
</funcsynopsis>
<para>
Returns true on success and false on error.
<para>
This function reopens the specified stream to new mailbox.
<para>
The options are a bit mask with one or more of the following:
<itemizedlist>
<listitem><simpara>
OP_READONLY - Open mailbox read-only
<listitem><simpara>
OP_ANONYMOUS - Dont use or update a .newsrc for news
<listitem><simpara>
OP_HALFOPEN - For IMAP and NNTP names, open a connection but
dont open a mailbox
<listitem><simpara>
CL_EXPUNGE - Expunge mailbox automatically upon mailbox close
</itemizedlist>
</refsect1>
</refentry>
<refentry id="function.imap-subscribe">
<refnamediv>
<refname>imap_subscribe</refname>
<refpurpose>Subscribe to a mailbox</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>imap_subscribe</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>string <parameter>mbox</parameter></paramdef>
</funcsynopsis>
<para>
Subscribe to a new mailbox.
<para>
Returns true on success and false on error.
</refsect1>
</refentry>
<refentry id="function.imap-undelete">
<refnamediv>
<refname>imap_undelete</refname>
<refpurpose>Unmark the message which is marked deleted</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>imap_undelete</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>int <parameter>msg_number</parameter></paramdef>
</funcsynopsis>
<para>
This function removes the deletion flag for a specified message,
which is set by <function>imap_delete</function>.
<para>
Returns true on success and false on error.
</refsect1>
</refentry>
<refentry id="function.imap-unsubscribe">
<refnamediv>
<refname>imap_unsubscribe</refname>
<refpurpose>Unsubscribe from a mailbox</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>imap_unsubscribe</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>string <parameter>mbox</parameter></paramdef>
</funcsynopsis>
<para>
Unsubscribe from a specified mailbox.
<para>
Returns true on success and false on error.
</refsect1>
</refentry>
<refentry id="function.imap-qprint">
<refnamediv>
<refname>imap_qprint</refname>
<refpurpose>Convert a quoted-printable string to an 8 bit
string</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>string <function>imap_qprint</function></funcdef>
<paramdef>string <parameter>string</parameter></paramdef>
</funcsynopsis>
<para>
Convert a quoted-printable string to an 8 bit string
<para>
Returns an 8 bit (binary) string
</refsect1>
</refentry>
<refentry id="function.imap-8bit">
<refnamediv>
<refname>imap_8bit</refname>
<refpurpose>Convert an 8bit string to a quoted-printable string.</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>string <function>imap_8bit</function></funcdef>
<paramdef>string <parameter>string</parameter></paramdef>
</funcsynopsis>
<para>
Convert an 8bit string to a quoted-printable string.
<para>
Returns a quoted-printable string
</refsect1>
</refentry>
<refentry id="function.imap-binary">
<refnamediv>
<refname>imap_binary</refname>
<refpurpose>Convert an 8bit string to a base64 string.</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>string <function>imap_binary</function></funcdef>
<paramdef>string <parameter>string</parameter></paramdef>
</funcsynopsis>
<para>
Convert an 8bit string to a base64 string.
<para>
Returns a base64 string
</refsect1>
</refentry>
<refentry id="function.imap-scanmailbox">
<refnamediv>
<refname>imap_scanmailbox</refname>
<refpurpose>Read the list of mailboxes, takes a string to search
for in the text of the mailbox</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>array <function>imap_scanmailbox</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>string <parameter>string</parameter></paramdef>
</funcsynopsis>
<para>
Returns an array containing the names of the mailboxes that have
<parameter>string</parameter> in the text of the mailbox.
</refsect1>
</refentry>
<refentry id="function.imap-mailboxmsginfo">
<refnamediv>
<refname>imap_mailboxmsginfo</refname>
<refpurpose>Get information about the current mailbox</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>array <function>imap_mailboxmsginfo</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
</funcsynopsis>
<para>
Returns information about the current mailbox. Returns FALSE on failure.
<para>
The <function>imap_mailboxmsginfo</function> function checks the
current mailbox status on the server and returns the information
in an object with following properties.
<para>
<informalexample>
<literallayout>
Date : date of the message
Driver : driver
Mailbox : name of the mailbox
Nmsgs : number of messages
Recent : number of recent messages
Unread : number of unread messages
Size : mailbox size
</literallayout>
</informalexample>
</refsect1>
</refentry>
<refentry id="function.imap-rfc822-write-address">
<refnamediv>
<refname>imap_rfc822_write_address</refname>
<refpurpose>Returns a properly formatted email address given the
mailbox, host, and personal info.</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>string <function>imap_rfc822_write_address</function></funcdef>
<paramdef>string <parameter>mailbox</parameter></paramdef>
<paramdef>string <parameter>host</parameter></paramdef>
<paramdef>string <parameter>personal</parameter></paramdef>
</funcsynopsis>
<para>
Returns a properly formatted email address given the mailbox,
host, and personal info.
</refsect1>
</refentry>
<refentry id="function.imap-rfc822-parse-adrlist">
<refnamediv>
<refname>imap_rfc822_parse_adrlist</refname>
<refpurpose>Parses an address string</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>string <function>imap_rfc822_parse_adrlist</function></funcdef>
<paramdef>string <parameter>address</parameter></paramdef>
<paramdef>string <parameter>default_host</parameter></paramdef>
</funcsynopsis>
<para>
This function parses the address tring and for each address,
returns an array of objects. The 4 objects are:
<para>
<informalexample>
<literallayout>
mailbox - the mailbox name (username)
host - the host name
personal - the personal name
adl - at domain source route
</literallayout>
</informalexample>
</refsect1>
</refentry>
<refentry id="function.imap-setflag-full">
<refnamediv>
<refname>imap_setflag_full</refname>
<refpurpose>Sets flags on messages</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>string <function>imap_setflag_full</function></funcdef>
<paramdef>int <parameter>stream</parameter></paramdef>
<paramdef>string <parameter>sequence</parameter></paramdef>
<paramdef>string <parameter>flag</parameter></paramdef>
<paramdef>string <parameter>options</parameter></paramdef>
</funcsynopsis>
<para>
This function causes a store to add the specified flag to the
flags set for the messages in the specified sequence.
<para>
The options are a bit mask with one or more of the following:
<informalexample>
<literallayout>
ST_UID The sequence argument contains UIDs instead of
sequence numbers
</literallayout>
</informalexample>
</refsect1>
</refentry>
<refentry id="function.imap-clearflag-full">
<refnamediv>
<refname>imap_clearflag_full</refname>
<refpurpose>Clears flags on messages</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>string <function>imap_clearflag_full</function></funcdef>
<paramdef>int <parameter>stream</parameter></paramdef>
<paramdef>string <parameter>sequence</parameter></paramdef>
<paramdef>string <parameter>flag</parameter></paramdef>
<paramdef>string <parameter>options</parameter></paramdef>
</funcsynopsis>
<para>
This function causes a store to delete the specified flag to the
flags set for the messages in the specified sequence.
<para>
The options are a bit mask with one or more of the following:
<informalexample>
<literallayout>
ST_UID The sequence argument contains UIDs instead of
sequence numbers
</literallayout>
</informalexample>
</refsect1>
</refentry>
<refentry id="function.imap-sort">
<refnamediv>
<refname>imap_sort</refname>
<refpurpose></refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>string <function>imap_sort</function></funcdef>
<paramdef>int <parameter>stream</parameter></paramdef>
<paramdef>int <parameter>criteria</parameter></paramdef>
<paramdef>int <parameter>reverse</parameter></paramdef>
<paramdef>int <parameter>options</parameter></paramdef>
</funcsynopsis>
<para>
Returns an array of message numbers sorted by the given
parameters
<para>
Rev is 1 for reverse-sorting.
<para>
Criteria can be one (and only one) of the following:
<informalexample>
<literallayout>
SORTDATE message Date
SORTARRIVAL arrival date
SORTFROM mailbox in first From address
SORTSUBJECT message Subject
SORTTO mailbox in first To address
SORTCC mailbox in first cc address
SORTSIZE size of message in octets
</literallayout>
</informalexample>
<para>
The flags are a bitmask of one or more of the following:
<informalexample>
<literallayout>
SE_UID Return UIDs instead of sequence numbers
SE_NOPREFETCH Don't prefetch searched messages.
</literallayout>
</informalexample>
</refsect1>
</refentry>
<refentry id="function.imap-fetchheader">
<refnamediv>
<refname>imap_fetchheader</refname>
<refpurpose>Returns header for a message</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>string<function>imap_fetchheader</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>int <parameter>msgno</parameter></paramdef>
<paramdef>int <parameter>flags</parameter></paramdef>
</funcsynopsis>
<para>
This function causes a fetch of the complete, unfiltered RFC 822
format header of the specified message as a text string and
returns that text string.
<para>
The options are:
<informalexample>
<literallayout>
FT_UID The msgno argument is a UID
FT_INTERNAL The return string is in "internal" format,
without any attempt to canonicalize to CRLF
newlines
FT_PREFETCHTEXT The RFC822.TEXT should be pre-fetched at the
same time. This avoids an extra RTT on an
IMAP connection if a full message text is
desired (e.g. in a "save to local file"
operation)
</literallayout>
</informalexample>
</refsect1>
</refentry>
<refentry id="function.imap-uid">
<refnamediv>
<refname>imap_uid</refname>
<refpurpose>This function returns the UID for the given message
sequence number.</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>string <function>imap_uid</function></funcdef>
<paramdef>string <parameter>mailbox</parameter></paramdef>
<paramdef>int <parameter>msgno</parameter></paramdef>
</funcsynopsis>
<para>
This function returns the UID for the given message sequence
number.
</refsect1>
</refentry>
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->