Include Cc in forwarded message, with option to toggle behaviour
[squirrelmail.git] / src / compose.php
index 2fc3ed79bd9ceb435e5fe6e58b82c00ac72e1966..de50217968706d9fc4cf4e9c709ed3cedc170872 100644 (file)
@@ -322,7 +322,7 @@ exit();
 function newMail () {
     global $forward_id, $imapConnection, $msg, $ent_num, $body_ary, $body,
            $reply_id, $send_to, $send_to_cc, $mailbox, $send_to_bcc, $editor_size,
-           $draft_id, $use_signature, $composesession;
+           $draft_id, $use_signature, $composesession, $forward_cc;
 
     $send_to = decodeHeader($send_to, false);
     $send_to_cc = decodeHeader($send_to_cc, false);
@@ -399,6 +399,14 @@ function newMail () {
                     $bodyTop .= '         ' . $orig_header->to[$x] . "\n";
                 }
             }
+            if (isset($forward_cc) && $forward_cc) {
+                $bodyTop .= _("Cc") . ': ' . $orig_header->cc[0] . "\n";
+                if (count($orig_header->cc) > 1) {
+                    for ($x = 1; $x < count($orig_header->cc); $x++) {
+                        $bodyTop .= '         ' . $orig_header->cc[$x] . "\n";
+                    }
+                }
+            }
             $bodyTop .= "\n";
             $body = $bodyTop . $body;
         }