Aleksander Machniak
2015-09-20 82dcbb7488ce1625ba4f41fbdc8e6319d3da9691
program/steps/mail/compose.inc
@@ -88,7 +88,7 @@
    'selectimportfile', 'messageissent', 'loadingdata', 'nopubkeyfor', 'nopubkeyforsender',
    'encryptnoattachments','encryptedsendialog','searchpubkeyservers', 'importpubkeys',
    'encryptpubkeysfound',  'search', 'close', 'import', 'keyid', 'keylength', 'keyexpired',
    'keyrevoked');
    'keyrevoked', 'keyimportsuccess', 'keyservererror');
$OUTPUT->set_pagetitle($RCMAIL->gettext('compose'));
@@ -782,15 +782,12 @@
            foreach ($MESSAGE->parts as $part) {
                if ($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)) {
                            $RCMAIL->output->set_env('pgp_mime_message', array(
                                '_mbox' => $RCMAIL->storage->get_folder(), '_uid' => $MESSAGE->uid, '_part' => $mime_id,
                            ));
                            $RCMAIL->output->set_env('compose_mode', $compose_mode);
                            $MESSAGE->pgp_mime = true;
                            break;
                        }
                    if ($pgp_mime_part = $MESSAGE->get_multipart_encrypted_part()) {
                        $RCMAIL->output->set_env('pgp_mime_message', array(
                            '_mbox' => $RCMAIL->storage->get_folder(),
                            '_uid'  => $MESSAGE->uid,
                            '_part' => $pgp_mime_part->mime_id,
                        ));
                    }
                    continue;
                }
@@ -878,7 +875,7 @@
    }
    // register this part as pgp encrypted
    if (strpos($body, 'BEGIN PGP MESSAGE') !== false) {
    if (strpos($body, '-----BEGIN PGP MESSAGE-----') !== false) {
        $MESSAGE->pgp_mime = true;
        $RCMAIL->output->set_env('pgp_mime_message', array(
            '_mbox' => $RCMAIL->storage->get_folder(), '_uid' => $MESSAGE->uid, '_part' => $part->mime_id,
@@ -1271,6 +1268,11 @@
                continue;
            }
            // skip version.txt parts of multipart/encrypted messages
            if ($message->pgp_mime && $part->mimetype == 'application/pgp-encrypted' && $part->filename == 'version.txt') {
                continue;
            }
            // skip message/rfc822 attachments on forwards (#1489214)
            // Thunderbird when forwarding in inline mode displays such attachments
            // and skips any attachments from inside of such part, this however