Example #1
0
          * the mailboxprefs by the default ones
          */
         $aMailboxPref[MBX_PREF_LIMIT] = (int) $show_num;
         $aMailboxPref[MBX_PREF_AUTO_EXPUNGE] = (bool) $auto_expunge;
         $aMailboxPref[MBX_PREF_INTERNALDATE] = (bool) getPref($data_dir, $username, 'internal_date_sort');
         $aConfig['search'] = $search['search'];
         $aConfig['charset'] = $search['charset'];
         $aConfig['setindex'] = 1;
         // $what $where = 'search'
         $aMailbox = sqm_api_mailbox_select($imapConnection, $mbx, $aConfig, $aMailboxPref);
         /**
          * Handle form actions like flag / unflag, seen / unseen, delete
          */
         if (sqgetGlobalVar('mailbox', $postMailbox, SQ_POST)) {
             if ($postMailbox === $mbx) {
                 handleMessageListForm($imapConnection, $aMailbox);
             }
         }
         if (fetchMessageHeaders($imapConnection, $aMailbox)) {
             $msgsfound = true;
             echo '<br />';
             asearch_print_mailbox_msgs($imapConnection, $aMailbox, $color);
             flush();
         }
         /* add the mailbox to the cache */
         $mailbox_cache[$aMailbox['NAME']] = $aMailbox;
     }
 }
 if (!$msgsfound) {
     echo '<br />' . html_tag('div', asearch_get_error_display($color, _("No Messages Found")), 'center') . "\n";
 }
Example #2
0
}
$iSetIndex = $aMailbox['SETINDEX'];
$aMailbox['CURRENT_MSG'][$iSetIndex] = $passed_id;
/**
 * Update the seen state
 * and ignore in_array('\\seen',$aMailbox['PERMANENTFLAGS'],true)
 */
if (isset($aMailbox['MSG_HEADERS'][$passed_id]['FLAGS'])) {
    $aMailbox['MSG_HEADERS'][$passed_id]['FLAGS']['\\seen'] = true;
}
/**
 * Process Delete from delete-move-next
 * but only if delete_id was set
 */
if (sqgetGlobalVar('delete_id', $delete_id, SQ_GET)) {
    handleMessageListForm($imapConnection, $aMailbox, $sButton = 'setDeleted', array($delete_id));
}
/**
 * $message contains all information about the message
 * including header and body
 */
if (isset($aMailbox['MSG_HEADERS'][$passed_id]['MESSAGE_OBJECT'])) {
    $message = $aMailbox['MSG_HEADERS'][$passed_id]['MESSAGE_OBJECT'];
    $FirstTimeSee = !$message->is_seen;
} else {
    $message = sqimap_get_message($imapConnection, $passed_id, $mailbox);
    $FirstTimeSee = !$message->is_seen;
}
/**
 * update message seen status and put in cache
 */