Thomas Bruederli
2015-07-31 2965a981b7ec22866fbdf2d567d87e2d068d3617
program/steps/mail/func.inc
@@ -64,17 +64,6 @@
    $mbox_name = $RCMAIL->storage->get_folder();
    if (empty($RCMAIL->action)) {
        // initialize searching result if search_filter is used
        if ($_SESSION['search_filter'] && $_SESSION['search_filter'] != 'ALL') {
            $RCMAIL->storage->search($mbox_name, $_SESSION['search_filter'], RCUBE_CHARSET, rcmail_sort_column());
            $search_request             = md5($mbox_name.$_SESSION['search_filter']);
            $_SESSION['search']         = $RCMAIL->storage->get_search_set();
            $_SESSION['search_request'] = $search_request;
            $OUTPUT->set_env('search_request', $search_request);
        }
        $OUTPUT->set_env('search_mods', rcmail_search_mods());
        if (!empty($_SESSION['search_scope']))
@@ -1196,7 +1185,23 @@
                // unsupported (e.g. encrypted)
                if ($part->realtype) {
                    if ($part->realtype == 'multipart/encrypted' || $part->realtype == 'application/pkcs7-mime') {
                        $out .= html::span('part-notice', $RCMAIL->gettext('encryptedmessage'));
                        if (!empty($_SESSION['browser_caps']['pgpmime']) && $part->realtype == 'multipart/encrypted') {
                            // find the encrypted message payload part
                            foreach ($MESSAGE->mime_parts as $mime_id => $mpart) {
                                if ($mpart->mimetype == 'application/octet-stream' || !empty($mpart->filename)) {
                                    $out .= html::span('part-notice', $RCMAIL->gettext('externalmessagedecryption'));
                                    $OUTPUT->set_env('pgp_mime_part', $mime_id);
                                    $OUTPUT->set_env('pgp_mime_container', '#' . $attrib['id']);
                                    $OUTPUT->add_label('loadingdata');
                                    $MESSAGE->encrypted_part = $mime_id;
                                    break;
                                }
                            }
                        }
                        if (!$MESSAGE->encrypted_part) {
                            $out .= html::span('part-notice', $RCMAIL->gettext('encryptedmessage'));
                        }
                    }
                    continue;
                }
@@ -1228,6 +1233,11 @@
                // message is cached but not exists (#1485443), or other error
                if ($body === false) {
                    rcmail_message_error($MESSAGE->uid);
                }
                // check if the message body is PGP encrypted
                if (strpos($body, 'BEGIN PGP MESSAGE') !== false) {
                    $OUTPUT->set_env('is_pgp_content', '#' . $attrib['id']);
                }
                $plugin = $RCMAIL->plugins->exec_hook('message_body_prefix',
@@ -2056,7 +2066,7 @@
    $select_filter->add($RCMAIL->gettext('priority').': '.$RCMAIL->gettext('low'), 'HEADER X-PRIORITY 4');
    $select_filter->add($RCMAIL->gettext('priority').': '.$RCMAIL->gettext('lowest'), 'HEADER X-PRIORITY 5');
    $out = $select_filter->show($_SESSION['search_filter']);
    $out = $select_filter->show($_REQUEST['_search'] ? $_SESSION['search_filter'] : 'ALL');
    $RCMAIL->output->add_gui_object('search_filter', $attrib['id']);