• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP imap_clearflag_full函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中imap_clearflag_full函数的典型用法代码示例。如果您正苦于以下问题:PHP imap_clearflag_full函数的具体用法?PHP imap_clearflag_full怎么用?PHP imap_clearflag_full使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了imap_clearflag_full函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: unreadMessages

function unreadMessages($messages)
{
    $mbox = getMbox();
    $messages = uidToSecuence($mbox, $messages);
    imap_clearflag_full($mbox, $messages, '\\Seen');
    imap_close($mbox);
}
开发者ID:palako,项目名称:mobilewebmail,代码行数:7,代码来源:performaction.php


示例2: unFlag

 public function unFlag($flag)
 {
     return imap_clearflag_full($this->ImapFolder->Imap->stream, $this->uid, $flag, ST_UID);
 }
开发者ID:robksawyer,项目名称:grabitdown,代码行数:4,代码来源:ImapLib.php


示例3: processAllEmails

function processAllEmails($mailbox, $emails, $rucReceptor)
{
    $returnArray = array("status" => true, "html" => "");
    $handlerUserCore = new UserCore();
    rsort($emails);
    $returnArray["html"] .= '   <table class="table table-condensed table-striped">
                                    <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>Remitente</th>
                                            <th>Fecha</th>
                                            <th>Docs.</th>
                                            <th>Estado</th>
                                            <th>Proc.</th>
                                        </tr>
                                    </thead>
                                    <tbody>';
    foreach ($emails as $email_number) {
        $status = '';
        // Traer datos generales de e-mail
        $overview = imap_fetch_overview($mailbox, $email_number, 0);
        //$message = imap_fetchbody($mailbox, $email_number, 2);
        $structure = imap_fetchstructure($mailbox, $email_number);
        $attachments = getEmailAttachments($mailbox, $email_number, $structure);
        $returnArray["html"] .= '<tr>';
        $returnArray["html"] .= '<td style="font-size: 11px;">' . $email_number . '</td>';
        $returnArray["html"] .= '<td style="font-size: 11px;">' . $overview[0]->from . '</td>';
        $returnArray["html"] .= '<td style="font-size: 11px;">' . date("Y-m-d", strtotime($overview[0]->date)) . '</td>';
        $returnArray["html"] .= '<td style="font-size: 11px;">' . count($attachments) . '</td>';
        $status .= '<ul class="pointmark" style="margin: 0px;">';
        if (count($attachments) > 0) {
            // Leer cada adjunto XML y procesarlo
            foreach ($attachments as $attachment) {
                if (strtolower($attachment["xml_extension"]) == "xml") {
                    $validArray = processXmlString($attachment["xml_attachment"], $attachment["pdf_attachment"], $attachment["pdf_extension"], $rucReceptor, $attachment["xml_basename"]);
                    $processed = $validArray["status"];
                }
                if ($processed) {
                    $status .= "<li>Adjunto XML (" . $attachment["xml_basename"] . "): Procesado con éxito</li>";
                } else {
                    $status .= "<li>" . $validArray["html"] . "</li>";
                }
            }
        } else {
            $status .= "<li>E-mail no tiene adjuntos</li>";
            $processed = false;
            $usuarioDefault = FlowSettingsCore::get(FLOW_RECEPCIONDOCUMENTOS, "RDE_DEF_ASIGNACION");
            $usuarioData = $handlerUserCore->getUserData($usuarioDefault);
            $email = $usuarioData["user_email"];
            $html = 'Estimado usuario<br /><br />
                     Le informamos que tiene un nuevo documento electrónico descargable en el buzón. Por favor ingrese a revisarlo y darle tratamiento';
            MailController::sendGeneralMail([["email" => $email]], "Nuevo documento electrónico descargable", $html);
        }
        $status .= '</ul>';
        if (FlowSettingsCore::get(FLOW_RECEPCIONDOCUMENTOS, "RDE_MC_PRUEBAS") != "1") {
            setEmailRead($email_number, $rucReceptor);
        } else {
            imap_clearflag_full($mailbox, $email_number, "\\Seen");
        }
        $returnArray["html"] .= '<td style="font-size: 11px;">' . $status . '</td>';
        if ($processed) {
            $returnArray["html"] .= '<td><span class="awe-ok" style="color: #6b9b20;"></span></td>';
        } else {
            $returnArray["html"] .= '<td><span class="awe-remove" style="color: #d43f3f;"></span></td>';
        }
        $returnArray["html"] .= '</tr>';
    }
    $returnArray["html"] .= "</table>";
    return $returnArray;
}
开发者ID:elcuy,项目名称:Novopan,代码行数:70,代码来源:JobDocElecMailChecker.php


示例4: flagMessages

 function flagMessages($flag, $aMessagesUID)
 {
     if (empty($aMessagesUID)) {
         return false;
     }
     reset($aMessagesUID);
     $msglist = '';
     while (list($key, $value) = each($aMessagesUID)) {
         if (!empty($msglist)) {
             $msglist .= ",";
         }
         $msglist .= $value;
     }
     switch ($flag) {
         case "flagged":
             $result = imap_setflag_full($this->stream(), $msglist, "\\Flagged", ST_UID);
             break;
         case "read":
             $result = imap_setflag_full($this->stream(), $msglist, "\\Seen", ST_UID);
             break;
         case "answered":
             $result = imap_setflag_full($this->stream(), $msglist, "\\Answered", ST_UID);
             break;
         case "unflagged":
             $result = imap_clearflag_full($this->stream(), $msglist, "\\Flagged", ST_UID);
             break;
         case "unread":
             $result = imap_clearflag_full($this->stream(), $msglist, "\\Seen", ST_UID);
             $result = imap_clearflag_full($this->stream(), $msglist, "\\Answered", ST_UID);
             break;
     }
     return $result;
 }
开发者ID:Sywooch,项目名称:dobox,代码行数:33,代码来源:class.imap.manager.php


示例5: setFlag

 /**
  * This function is used to enable or disable one or more flags on the imap message.
  *
  * @param  string|array              $flag   Flagged, Answered, Deleted, Seen, Draft
  * @param  bool                      $enable
  * @throws \InvalidArgumentException
  * @return bool
  */
 public function setFlag($flag, $enable = true)
 {
     $flags = is_array($flag) ? $flag : array($flag);
     foreach ($flags as $i => $flag) {
         $flag = ltrim(strtolower($flag), '\\');
         if (!in_array($flag, self::$flagTypes) || $flag == self::FLAG_RECENT) {
             throw new \InvalidArgumentException('Unable to set invalid flag "' . $flag . '"');
         }
         if ($enable) {
             $this->status[$flag] = true;
         } else {
             unset($this->status[$flag]);
         }
         $flags[$i] = $flag;
     }
     $imapifiedFlag = '\\' . implode(' \\', array_map('ucfirst', $flags));
     if ($enable === true) {
         return imap_setflag_full($this->imapStream, $this->uid, $imapifiedFlag, ST_UID);
     } else {
         return imap_clearflag_full($this->imapStream, $this->uid, $imapifiedFlag, ST_UID);
     }
 }
开发者ID:activecollab,项目名称:Fetch,代码行数:30,代码来源:Message.php


示例6: mailcwp_mark_unread_callback

function mailcwp_mark_unread_callback()
{
    $mailcwp_session = mailcwp_get_session();
    if (!isset($mailcwp_session) || empty($mailcwp_session)) {
        return;
    }
    $account = $mailcwp_session["account"];
    //$from = $account["email"];
    $folder = $mailcwp_session["folder"];
    $messages = $_POST["messages"];
    $mbox = mailcwp_imap_connect($account, 0, $folder);
    imap_clearflag_full($mbox, $messages, "\\Seen");
    //mailcwp_get_unseen_messages($account);
    //write_log(print_r(imap_errors(), true));
    echo json_encode(array("result" => "OK"));
    die;
}
开发者ID:TouTrix,项目名称:mailcwp,代码行数:17,代码来源:mailcwp.php


示例7: markMailUnread

 /**
  * Marks the mail as Unread
  * @param <String> $msgno - Message Number
  */
 function markMailUnread($msgno)
 {
     imap_clearflag_full($this->mBox, $msgno, '\\Seen');
     $this->mModified = true;
 }
开发者ID:hbsman,项目名称:vtigercrm-5.3.0-ja,代码行数:9,代码来源:Connector.php


示例8: MoveMessage

 /**
  * Called when the user moves an item on the PDA from one folder to another
  *
  * @param string              $folderid            id of the source folder
  * @param string              $id                  id of the message
  * @param string              $newfolderid         id of the destination folder
  * @param ContentParameters   $contentparameters
  *
  * @access public
  * @return boolean                      status of the operation
  * @throws StatusException              could throw specific SYNC_MOVEITEMSSTATUS_* exceptions
  */
 public function MoveMessage($folderid, $id, $newfolderid, $contentparameters)
 {
     ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->MoveMessage('%s','%s','%s')", $folderid, $id, $newfolderid));
     $folderImapid = $this->getImapIdFromFolderId($folderid);
     $newfolderImapid = $this->getImapIdFromFolderId($newfolderid);
     if ($folderImapid == $newfolderImapid) {
         throw new StatusException(sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): Error, destination folder is source folder. Canceling the move.", $folderid, $id, $newfolderid), SYNC_MOVEITEMSSTATUS_SAMESOURCEANDDEST);
     }
     $this->imap_reopen_folder($folderImapid);
     if ($this->imap_inside_cutoffdate(Utils::GetCutOffDate($contentparameters->GetFilterType()), $id)) {
         // read message flags
         $overview = @imap_fetch_overview($this->mbox, $id, FT_UID);
         if (!is_array($overview)) {
             throw new StatusException(sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): Error, unable to retrieve overview of source message: %s", $folderid, $id, $newfolderid, imap_last_error()), SYNC_MOVEITEMSSTATUS_INVALIDSOURCEID);
         } else {
             // get next UID for destination folder
             // when moving a message we have to announce through ActiveSync the new messageID in the
             // destination folder. This is a "guessing" mechanism as IMAP does not inform that value.
             // when lots of simultaneous operations happen in the destination folder this could fail.
             // in the worst case the moved message is displayed twice on the mobile.
             $destStatus = imap_status($this->mbox, $this->server . $newfolderImapid, SA_ALL);
             if (!$destStatus) {
                 throw new StatusException(sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): Error, unable to open destination folder: %s", $folderid, $id, $newfolderid, imap_last_error()), SYNC_MOVEITEMSSTATUS_INVALIDDESTID);
             }
             $newid = $destStatus->uidnext;
             // move message
             $s1 = imap_mail_move($this->mbox, $id, $newfolderImapid, CP_UID);
             if (!$s1) {
                 throw new StatusException(sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): Error, copy to destination folder failed: %s", $folderid, $id, $newfolderid, imap_last_error()), SYNC_MOVEITEMSSTATUS_CANNOTMOVE);
             }
             // delete message in from-folder
             $s2 = imap_expunge($this->mbox);
             // open new folder
             $stat = $this->imap_reopen_folder($newfolderImapid);
             if (!$stat) {
                 throw new StatusException(sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): Error, opening the destination folder: %s", $folderid, $id, $newfolderid, imap_last_error()), SYNC_MOVEITEMSSTATUS_CANNOTMOVE);
             }
             // remove all flags
             $s3 = @imap_clearflag_full($this->mbox, $newid, "\\Seen \\Answered \\Flagged \\Deleted \\Draft", FT_UID);
             $newflags = "";
             $move_to_trash = strcasecmp($newfolderImapid, $this->create_name_folder(IMAP_FOLDER_TRASH)) == 0;
             if ($overview[0]->seen || $move_to_trash && defined('IMAP_AUTOSEEN_ON_DELETE') && IMAP_AUTOSEEN_ON_DELETE == true) {
                 $newflags .= "\\Seen";
             }
             if ($overview[0]->flagged) {
                 $newflags .= " \\Flagged";
             }
             if ($overview[0]->answered) {
                 $newflags .= " \\Answered";
             }
             $s4 = @imap_setflag_full($this->mbox, $newid, $newflags, FT_UID);
             ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): result s-move: '%s' s-expunge: '%s' unset-Flags: '%s' set-Flags: '%s'", $folderid, $id, $newfolderid, Utils::PrintAsString($s1), Utils::PrintAsString($s2), Utils::PrintAsString($s3), Utils::PrintAsString($s4)));
             // return the new id "as string"
             return $newid . "";
         }
     } else {
         throw new StatusException(sprintf("BackendIMAP->MoveMessage(): Message is outside the sync range"), SYNC_MOVEITEMSSTATUS_INVALIDSOURCEID);
     }
 }
开发者ID:peterbeck,项目名称:Z-Push-contrib,代码行数:71,代码来源:imap.php


示例9: set_flag

 /**
  * This function is used to enable or disable a flag on the imap message.
  *
  * @param string $flag Flagged, Answered, Deleted, Seen, Draft
  * @param bool $enable
  * @return bool
  */
 public function set_flag($flag, $enable = TRUE)
 {
     if (!in_array($flag, self::$flag_types) or $flag == 'recent') {
         throw new Imap_Exception('Unable to set invalid flag "' . $flag . '"');
     }
     $flag = '\\' . ucfirst($flag);
     if ($enable) {
         return imap_setflag_full($this->imap_stream, $this->uid, $flag, ST_UID);
     } else {
         return imap_clearflag_full($this->imap_stream, $this->uid, $flag, ST_UID);
     }
 }
开发者ID:alle,项目名称:kohana-imap,代码行数:19,代码来源:Message.php


示例10: flagMessages

 function flagMessages($_flag, $_messageUID)
 {
     reset($_messageUID);
     while (list($key, $value) = each($_messageUID)) {
         if (!empty($msglist)) {
             $msglist .= ",";
         }
         $msglist .= $value;
     }
     switch ($_flag) {
         case "flagged":
             $result = imap_setflag_full($this->mbox, $msglist, "\\Flagged", ST_UID);
             break;
         case "read":
             $result = imap_setflag_full($this->mbox, $msglist, "\\Seen", ST_UID);
             break;
         case "answered":
             $result = imap_setflag_full($this->mbox, $msglist, "\\Answered", ST_UID);
             break;
         case "unflagged":
             $result = imap_clearflag_full($this->mbox, $msglist, "\\Flagged", ST_UID);
             break;
         case "unread":
             $result = imap_clearflag_full($this->mbox, $msglist, "\\Seen", ST_UID);
             $result = imap_clearflag_full($this->mbox, $msglist, "\\Answered", ST_UID);
             break;
     }
     #print "Result: $result<br>";
 }
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:29,代码来源:class.bofelamimail.inc.php


示例11: join

    /*
    print $seq;
    print $_POST["moveto"];
    print $res;
    */
} else {
    if ($act == "flags") {
        if (isset($_POST["msgmark"])) {
            $seq = join(",", array_keys($_POST["msgmark"]));
        }
        $flag = $_POST["flag"];
        if ("read" == $flag) {
            imap_setflag_full($mbox, $seq, "\\Seen", ST_UID);
        }
        if ("unread" == $flag) {
            imap_clearflag_full($mbox, $seq, "\\Seen", ST_UID);
        }
        print "[\n";
        if (isset($_REQUEST["msgids"])) {
            $ovr = imap_fetch_overview($mbox, $_REQUEST["msgids"], FT_UID);
            foreach ($ovr as $mkey => $msgobj) {
                printf("{'type': 'mflag', 'msgid': '%d', 'seen': %d, 'answered': %d},\n", $msgobj->uid, $msgobj->seen, $msgobj->answered);
            }
        }
        $mboxinf = imap_status($mbox, $mboxspec, SA_ALL);
        $msg_total = $mboxinf->messages;
        $msg_unread = $mboxinf->unseen;
        printf("{'type': 'mbox', 'caption': '%s', 'name': '%s', 'total': %d, 'unread': %d},\n", get_folder_caption($mailbox), $mailbox, $msg_total, $msg_unread);
        print "];";
        // edasi .. see asi peab tagastama packeti iga mailboxis olnud kirja kohta, sest mõni neist võib olla
        // muutunud loetuks mõnel muul moel .. s.t. siis query_server peab tagastama kõik kirjad,
开发者ID:automatweb,项目名称:automatweb_sales,代码行数:31,代码来源:imap.php


示例12: setFlags

 /**
  * Wrapper function for {@link imap_setflag_full}.  Sets various message flags.
  * Accepts an array of message ids and an array of flags to be set.
  *
  * The flags which you can set are "\\Seen", "\\Answered", "\\Flagged",
  * "\\Deleted", and "\\Draft" (as defined by RFC2060).
  *
  * Warning: POP3 mailboxes do not remember flag settings from connection to connection.
  *
  * @param    array  $mids        Array of message ids to set flags on.
  * @param    array  $flags       Array of flags to set on messages.
  * @param    int    $action      Flag operation toggle one of MAIL_IMAP_SET_FLAGS (default) or
  *                               MAIL_IMAP_CLEAR_FLAGS.
  * @param    int    $options
  *   (optional) sets the forth argument of {@link imap_setflag_full} or {@imap_clearflag_full}.
  *
  * @return   BOOL|PEAR_Error
  * @throws   Message IDs and Flags are to be supplied as arrays.  Remedy: place message ids
  *           and flags in arrays.
  * @access   public
  * @see      imap_setflag_full
  * @see      imap_clearflag_full
  */
 function setFlags($mids, $flags, $action = 3, $options = NULL)
 {
     if (is_array($mids) && is_array($flags)) {
         if ($action == MAIL_IMAP_SET_FLAGS) {
             if (isset($this->option['setflag_full'])) {
                 $options = $this->option['setflag_full'];
             }
             return @imap_setflag_full($this->mailbox, implode(',', $mids), implode(' ', $flags), $options);
         } else {
             if (isset($this->option['clearflag_full'])) {
                 $options = $this->option['clearflag_full'];
             }
             return @imap_clearflag_full($this->mailbox, implode(',', $mids), implode(' ', $flags), $options);
         }
     } else {
         return PEAR::raiseError('Mail_IMAP::setFlags: First and second arguments must be arrays.');
     }
 }
开发者ID:manishkhanchandani,项目名称:mkgxy,代码行数:41,代码来源:IMAP.php


示例13: mail_SetFlag

function mail_SetFlag($conn, $mail, $flag)
{
    switch ($flag) {
        case 'Seen':
            return @imap_setflag_full($conn, $mail, "\\Seen", SE_UID);
            break;
        case 'Unseen':
            return @imap_clearflag_full($conn, $mail, "\\Seen", SE_UID);
            break;
        case 'Flagged':
            return @imap_setflag_full($conn, $mail, "\\Flagged", SE_UID);
            break;
        case 'Unflagged':
            return @imap_clearflag_full($conn, $mail, "\\Flagged", SE_UID);
            break;
        case 'Delete':
            mail_dele($conn, $mail);
            break;
        case 'Draft':
            return @imap_setflag_full($conn, $mail, "\\Draft", SE_UID);
            break;
        case 'Answerd':
            return @imap_setflag_full($conn, $mail, "\\Answered", SE_UID);
            break;
        default:
            return false;
    }
}
开发者ID:vanloswang,项目名称:kivitendo-crm,代码行数:28,代码来源:mailLib.php


示例14: clearFLag

 public function clearFLag($str, $list)
 {
     if (empty($list) || gettype($list) != 'array') {
         return 'Nieprawidłowy format danych wejsciowych';
     }
     $xy = implode(",", $list);
     imap_clearflag_full($this->mbox, $xy, $str, ST_UID);
 }
开发者ID:skrokbogumil,项目名称:KlientPoczty,代码行数:8,代码来源:mailService.php


示例15: removeFlagMessagesFilter

 /**
  * Remove a flag que caracteriza uma mensagem como alertada por Filtro por Remetente.
  * se houver o parametro msg_number, então remove a flag de uma msg especifica
  * se não houver o parametro msg_number, mas sim o from, então remove a flag de todas as msgs da pasta (parametro from),
  * e que o remetente for o from.
  */
 function removeFlagMessagesFilter($params)
 {
     $message_number = $params['msg_number'];
     $folder = $params['folder'];
     if (isset($message_number)) {
         if (isset($folder)) {
             $message_number = explode(',', $message_number);
             $this->mbox = $this->open_mbox($folder);
             foreach ($message_number as $k => $m) {
                 imap_clearflag_full($this->mbox, $m, '$FilteredMessage', ST_UID);
             }
         }
     } else {
         $from = $params['from'];
         if (isset($folder) && isset($from)) {
             $this->mbox = $this->open_mbox($folder);
             $messages = imap_search($this->mbox, 'UNDELETED UNSEEN KEYWORD "$FilteredMessage"', SE_UID);
         }
         if (is_array($messages)) {
             foreach ($messages as $k => $m) {
                 $headers = imap_fetch_overview($this->mbox, $m, FT_UID);
                 if (strpos($headers[0]->from, $from) > 0) {
                     imap_clearflag_full($this->mbox, $m, '$FilteredMessage', ST_UID);
                 }
             }
         }
     }
     return array('status' => "success");
 }
开发者ID:cjvaz,项目名称:expressomail,代码行数:35,代码来源:class.imap_functions.inc.php


示例16: getBody

 function getBody($msg_number)
 {
     $header = imap_headerinfo($this->mbox_stream, imap_msgno($this->mbox_stream, $msg_number), 80, 255);
     $body = imap_body($this->mbox_stream, $msg_number, FT_UID);
     if ($header->Unseen == 'U' || $header->Recent == 'N') {
         imap_clearflag_full($this->mbox_stream, $msg_number, "\\Seen", ST_UID);
     }
     return $body;
 }
开发者ID:cjvaz,项目名称:expressomail,代码行数:9,代码来源:class.exporteml.inc.php


示例17: MoveMessage

 /**
  * Called when the user moves an item on the PDA from one folder to another
  *
  * @param string              $folderid            id of the source folder
  * @param string              $id                  id of the message
  * @param string              $newfolderid         id of the destination folder
  * @param ContentParameters   $contentparameters
  *
  * @access public
  * @return boolean                      status of the operation
  * @throws StatusException              could throw specific SYNC_MOVEITEMSSTATUS_* exceptions
  */
 public function MoveMessage($folderid, $id, $newfolderid, $contentparameters)
 {
     ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->MoveMessage('%s','%s','%s')", $folderid, $id, $newfolderid));
     $folderImapid = $this->getImapIdFromFolderId($folderid);
     // SDB: When iOS is configured to "Archive Message" (instead of Delete Message), it will send a "MoveItems"
     // command to the Exchange server and attempt to move it to a folder called "0/Archive". Instead, we trap that
     // and send it to "[Gmail]/All Mail" folder instead. Note, that when on iOS device and you trigger a move from
     // folder A to B, it will correctly move that email, including to all folders with "[Gmail]...".
     if ($newfolderid == "0/Archive") {
         $newfolderImapid = "[Gmail]/All Mail";
     } else {
         $newfolderImapid = $this->getImapIdFromFolderId($newfolderid);
     }
     if ($folderImapid == $newfolderImapid) {
         throw new StatusException(sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): Error, destination folder is source folder. Canceling the move.", $folderid, $id, $newfolderid), SYNC_MOVEITEMSSTATUS_SAMESOURCEANDDEST);
     }
     $this->imap_reopen_folder($folderImapid);
     if ($this->imap_inside_cutoffdate(Utils::GetCutOffDate($contentparameters->GetFilterType()), $id)) {
         // read message flags
         $overview = @imap_fetch_overview($this->mbox, $id, FT_UID);
         if (!is_array($overview)) {
             throw new StatusException(sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): Error, unable to retrieve overview of source message: %s", $folderid, $id, $newfolderid, imap_last_error()), SYNC_MOVEITEMSSTATUS_INVALIDSOURCEID);
         } else {
             // get next UID for destination folder
             // when moving a message we have to announce through ActiveSync the new messageID in the
             // destination folder. This is a "guessing" mechanism as IMAP does not inform that value.
             // when lots of simultaneous operations happen in the destination folder this could fail.
             // in the worst case the moved message is displayed twice on the mobile.
             $destStatus = imap_status($this->mbox, $this->server . $newfolderImapid, SA_ALL);
             if (!$destStatus) {
                 throw new StatusException(sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): Error, unable to open destination folder: %s", $folderid, $id, $newfolderid, imap_last_error()), SYNC_MOVEITEMSSTATUS_INVALIDDESTID);
             }
             $newid = $destStatus->uidnext;
             // move message
             $s1 = imap_mail_move($this->mbox, $id, $newfolderImapid, CP_UID);
             if (!$s1) {
                 throw new StatusException(sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): Error, copy to destination folder failed: %s", $folderid, $id, $newfolderid, imap_last_error()), SYNC_MOVEITEMSSTATUS_CANNOTMOVE);
             }
             // delete message in from-folder
             $s2 = imap_expunge($this->mbox);
             // open new folder
             $stat = $this->imap_reopen_folder($newfolderImapid);
             if (!$s1) {
                 throw new StatusException(sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): Error, opening the destination folder: %s", $folderid, $id, $newfolderid, imap_last_error()), SYNC_MOVEITEMSSTATUS_CANNOTMOVE);
             }
             // remove all flags
             $s3 = @imap_clearflag_full($this->mbox, $newid, "\\Seen \\Answered \\Flagged \\Deleted \\Draft", FT_UID);
             $newflags = "";
             if ($overview[0]->seen) {
                 $newflags .= "\\Seen";
             }
             if ($overview[0]->flagged) {
                 $newflags .= " \\Flagged";
             }
             if ($overview[0]->answered) {
                 $newflags .= " \\Answered";
             }
             $s4 = @imap_setflag_full($this->mbox, $newid, $newflags, FT_UID);
             ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): result s-move: '%s' s-expunge: '%s' unset-Flags: '%s' set-Flags: '%s'", $folderid, $id, $newfolderid, Utils::PrintAsString($s1), Utils::PrintAsString($s2), Utils::PrintAsString($s3), Utils::PrintAsString($s4)));
             // return the new id "as string"
             return $newid . "";
         }
     } else {
         throw new StatusException(sprintf("BackendIMAP->MoveMessage(): Message is outside the sync range"), SYNC_MOVEITEMSSTATUS_INVALIDSOURCEID);
     }
 }
开发者ID:alanturing1,项目名称:Z-Push-contrib,代码行数:78,代码来源:imap.php


示例18: mark_unread

/**
 * Marks an email Unread
 * @param array $action Array of options and criteria for the action current being processed
 * @param string $ieId ID of InboundEmail instance fully retrieved
 * @param string $uid UID of email
 */
function mark_unread($action, $bean, $ie)
{
    return imap_clearflag_full($ie->conn, $bean->uid, '\\Seen', ST_UID);
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:10,代码来源:baseActions.php


示例19: MoveMessage

 /**
  * Called when the user moves an item on the PDA from one folder to another
  *
  * @param string        $folderid       id of the source folder
  * @param string        $id             id of the message
  * @param string        $newfolderid    id of the destination folder
  *
  * @access public
  * @return boolean                      status of the operation
  * @throws StatusException              could throw specific SYNC_MOVEITEMSSTATUS_* exceptions
  */
 public function MoveMessage($folderid, $id, $newfolderid)
 {
     ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->MoveMessage('%s','%s','%s')", $folderid, $id, $newfolderid));
     $folderImapid = $this->getImapIdFromFolderId($folderid);
     $newfolderImapid = $this->getImapIdFromFolderId($newfolderid);
     $this->imap_reopenFolder($folderImapid);
     // TODO this should throw a StatusExceptions on errors like SYNC_MOVEITEMSSTATUS_SAMESOURCEANDDEST,SYNC_MOVEITEMSSTATUS_INVALIDSOURCEID,SYNC_MOVEITEMSSTATUS_CANNOTMOVE
     // read message flags
     $overview = @imap_fetch_overview($this->mbox, $id, FT_UID);
     if (!$overview) {
         throw new StatusException(sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): Error, unable to retrieve overview of source message: %s", $folderid, $id, $newfolderid, imap_last_error()), SYNC_MOVEITEMSSTATUS_INVALIDSOURCEID);
     } else {
         // get next UID for destination folder
         // when moving a message we have to announce through ActiveSync the new messageID in the
         // destination folder. This is a "guessing" mechanism as IMAP does not inform that value.
         // when lots of simultaneous operations happen in the destination folder this could fail.
         // in the worst case the moved message is displayed twice on the mobile.
         $destStatus = imap_status($this->mbox, $this->server . $newfolderImapid, SA_ALL);
         if (!$destStatus) {
             throw new StatusException(sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): Error, unable to open destination folder: %s", $folderid, $id, $newfolderid, imap_last_error()), SYNC_MOVEITEMSSTATUS_INVALIDDESTID);
         }
         $newid = $destStatus->uidnext;
         // move message
         $s1 = imap_mail_move($this->mbox, $id, $newfolderImapid, CP_UID);
         if (!$s1) {
             throw new StatusException(sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): Error, copy to destination folder failed: %s", $folderid, $id, $newfolderid, imap_last_error()), SYNC_MOVEITEMSSTATUS_CANNOTMOVE);
         }
         // delete message in from-folder
         $s2 = imap_expunge($this->mbox);
         // open new folder
         $stat = $this->imap_reopenFolder($newfolderImapid);
         if (!$s1) {
             throw new StatusException(sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): Error, openeing the destination folder: %s", $folderid, $id, $newfolderid, imap_last_error()), SYNC_MOVEITEMSSTATUS_CANNOTMOVE);
         }
         // remove all flags
         $s3 = @imap_clearflag_full($this->mbox, $newid, "\\Seen \\Answered \\Flagged \\Deleted \\Draft", FT_UID);
         $newflags = "";
         if ($overview[0]->seen) {
             $newflags .= "\\Seen";
         }
         if ($overview[0]->flagged) {
             $newflags .= " \\Flagged";
         }
         if ($overview[0]->answered) {
             $newflags .= " \\Answered";
         }
         $s4 = @imap_setflag_full($this->mbox, $newid, $newflags, FT_UID);
         ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): result s-move: '%s' s-expunge: '%s' unset-Flags: '%s' set-Flags: '%s'", $folderid, $id, $newfolderid, Utils::PrintAsString($s1), Utils::PrintAsString($s2), Utils::PrintAsString($s3), Utils::PrintAsString($s4)));
         // return the new id "as string""
         return $newid . "";
     }
 }
开发者ID:BackupTheBerlios,项目名称:z-push-svn,代码行数:63,代码来源:imap.php


示例20: markMessage

 /**
  * Mark the message in the mailbox.
  */
 function markMessage($messageid, $flags = null)
 {
     $markas = $this->_scannerinfo->markas;
     if ($this->_imap) {
         if ($markas) {
             if (strtoupper($markas) == 'SEEN') {
                 $markas = "\\Seen";
                 imap_setflag_full($this->_imap, $messageid, $markas);
             } else {
                 if ($flags['Unseen'] == 'U') {
                     imap_clearflag_full($this->_imap, $messageid, "\\Seen");
                 }
             }
         } else {
             if ($flags['Unseen'] == 'U') {
                 imap_clearflag_full($this->_imap, $messageid, "\\Seen");
             }
         }
     }
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:23,代码来源:MailBox.php



注:本文中的imap_clearflag_full函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP imap_close函数代码示例发布时间:2022-05-15
下一篇:
PHP imap_check函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap