Source for file ManageMB.php
Documentation is available at ManageMB.php
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//\\\ @@ @@\\\\\\| Mail_IMAPv2 \\
//\\ @@@@ @@@@\\\\\|___________________________________________________________\\
//\\\ @@ |\\@@\\\\\\|(c) Copyright 2004-2005 Richard York, All rights Reserved \\
//\\\\ || \\\\\\\|___________________________________________________________\\
//\\\\ \\_ \\\\\\|Redistribution and use in source and binary forms, with or \\
//\\\\\ \\\\\|without modification, are permitted provided that the \\
//\\\\\ ---- \@@@@|following conditions are met: \\
//@@@@@@\ \@@@@@| o Redistributions of source code must retain the above \\
//\\\\\\\\\\\\\\\\\\| copyright notice, this list of conditions and the \\
// following disclaimer. \\
// o Redistributions in binary form must reproduce the above copyright notice, \\
// this list of conditions and the following disclaimer in the documentation \\
// and/or other materials provided with the distribution. \\
// o The names of the authors may not be used to endorse or promote products \\
// derived from this software without specific prior written permission. \\
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" \\
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \\
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE \\
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \\
// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \\
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \\
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS \\
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN \\
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \\
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \\
// POSSIBILITY OF SUCH DAMAGE. \\
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
* This class provides an extension to Mail_IMAPv2 that adds mailbox management
* features. These features include the ability to create/rename/delete
* (sub)mailboxes on the server, as well as the ability to move/copy mail
* from one folder to another, and finally the ability to import messages
* @author Richard York <rich_y@php.net>
* @copyright (c) Copyright 2004, Richard York, All Rights Reserved.
* @tutorial http://www.smilingsouls.net/Mail_IMAP
* @todo add simple message filter function
* @tutorial http://www.smilingsouls.net/Mail_IMAP?content=Mail_IMAP_ManageMB/Mail_IMAP_ManageMB
* This method creates, renames and deletes mailboxes from the server.
* One of create|rename|delete, this tells the method what you want to
* The name of the mailbox to create, delete or rename.
* @param string $mb_rename
* (optional) New name for the mailbox, if it is being renamed.
* @see imap_createmailbox
* @see imap_renamemailbox
* @see imap_deletemailbox
* @tutorial http://www.smilingsouls.net/Mail_IMAP?content=Mail_IMAP_ManageMB/manageMB
function manageMB($action, $mb_name, $mb_rename = NULL )
if (@imap_createmailbox ($this->mailbox, imap_utf7_encode ($this->mailboxInfo['host']. 'INBOX.'. $mb_name))) {
* This method manages the mail inside of a mailbox and allows mail to be
* copied or moved from the mailbox that the user is connected to to the
* One of copy|move if copy, a copy of the message will remain in the
* current mailbox. If move the message is permenently moved to the
* An array of messages to move, see (@link imap_mail_copy} or {@link imap_mail_move}
* for more options. The array is imploded into a comma separated list, therefore
* other options such as 1:10 syntax or * syntax may be specified in the array.
* The destination mailbox, such as 'INBOX.Drafts' or 'INBOX.Sent'
* @tutorial http://www.smilingsouls.net/Mail_IMAP?content=Mail_IMAP_ManageMB/manageMail
$msg_list = implode($msg_list, ',');
$opt = (isset ($this->option['mail_move']))? $this->option['mail_move'] : NULL;
$opt = (isset ($this->option['mail_copy']))? $this->option['mail_copy'] : NULL;
$action = 'imap_mail_'. $action;
if (@$action($this->mailbox, $msg_list, $dest_mb, $opt)) {
$this->error->push (Mail_IMAPv2_ERROR, 'error', NULL , 'Unable to copy or move messages, imap_mail_'. $action. ' failed!');
* This method provides the functionality to import MIME messages into the server
* using the {@link imap_append} method.
* The destination mailbox where the messages will be imported to.
* An array of MIME messages to import.
* @tutorial http://www.smilingsouls.net/Mail_IMAP?content=Mail_IMAP_ManageMB/importMail
$opt = (isset ($this->option['append']))? $this->option['append'] : NULL;
foreach ($messages as $msg) {
Documentation generated on Mon, 11 Mar 2019 15:40:09 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|