From: stekkel Date: Fri, 16 Aug 2002 12:19:11 +0000 (+0000) Subject: fix for forwarding message/rfc822 entities as attachment X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=756406dff19047c7912fba65afaa3fbccea39067;p=squirrelmail.git fix for forwarding message/rfc822 entities as attachment git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3324 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/src/compose.php b/src/compose.php index b1487101..86844989 100644 --- a/src/compose.php +++ b/src/compose.php @@ -552,7 +552,7 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se getAttachments($message, $session, $passed_id, $entities, $imapConnection); break; case ('forward_as_attachment'): - getMessage_RFC822_Attachment($message, $session, $passed_id, $imapConnection); + getMessage_RFC822_Attachment($message, $session, $passed_id, $passed_ent_id, $imapConnection); $body = ''; break; case ('reply_all'): @@ -660,10 +660,20 @@ function getAttachments($message, $session, $passed_id, $entities, $imapConnecti return; } -function getMessage_RFC822_Attachment($message, $session, $passed_id, $imapConnection) { +function getMessage_RFC822_Attachment($message, $session, $passed_id, + $passed_ent_id='', $imapConnection) { global $attachments, $attachment_dir, $username, $data_dir, $uid_support; $hashed_attachment_dir = getHashedDir($username, $attachment_dir); - $body_a = sqimap_run_command($imapConnection, "FETCH $passed_id RFC822",true, $response, $readmessage, $uid_support); + if (!$passed_ent_id) { + $body_a = sqimap_run_command($imapConnection, + 'FETCH '.$passed_id.' RFC822', + true, $response, $readmessage, $uid_support); + } else { + $body_a = sqimap_run_command($imapConnection, + 'FETCH '.$passed_id.' BODY['.$passed_ent_id.']', + true, $response, $readmessage, $uid_support); + $message = $message->parent; + } if ($response = 'OK') { $subject = encodeHeader($message->rfc822_header->subject); array_shift($body_a);