X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fread_body.php;h=74f4e96008221366fbf291aaebe35eabb28d1fb7;hb=e50f5ac2682d655013d18d97f9a2aa30b7ed9485;hp=0fc323fa0c55f283561d0a5637c8f435fd8515de;hpb=39bfea8fa9fd939da9766a79381f68ea4b725c23;p=squirrelmail.git diff --git a/src/read_body.php b/src/read_body.php index 0fc323fa..74f4e960 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -1,8 +1,9 @@ rfc822_header; - $hashed_attachment_dir = getHashedDir($username, $attachment_dir); $rfc822_header = new Rfc822Header(); $content_type = new ContentType('multipart/report'); @@ -184,9 +183,9 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) { $now = getLongDateString( time() ); set_my_charset(); $body = _("Your message") . "\r\n\r\n" . - "\t" . _("To:") . ' ' . decodeHeader($to,false,false) . "\r\n" . - "\t" . _("Subject:") . ' ' . decodeHeader($header->subject,false,false) . "\r\n" . - "\t" . _("Sent:") . ' ' . $senton . "\r\n" . + "\t" . _("To") . ': ' . decodeHeader($to,false,false) . "\r\n" . + "\t" . _("Subject") . ': ' . decodeHeader($header->subject,false,false) . "\r\n" . + "\t" . _("Sent") . ': ' . $senton . "\r\n" . "\r\n" . sprintf( _("Was displayed on %s"), $now ); @@ -202,6 +201,8 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) { $special_encoding = '7bit'; } } + } elseif (sq_is8bit($body)) { + $special_encoding = '8bit'; } $part1 = new Message(); $part1->setBody($body); @@ -253,7 +254,7 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) { } else { require_once(SM_PATH . 'class/deliver/Deliver_SMTP.class.php'); $deliver = new Deliver_SMTP(); - global $smtpServerAddress, $smtpPort, $smtp_auth_mech, $pop_before_smtp; + global $smtpServerAddress, $smtpPort, $pop_before_smtp; $authPop = (isset($pop_before_smtp) && $pop_before_smtp) ? true : false; get_smtp_user($user, $pass); $stream = $deliver->initStream($composeMessage,$domain,0, @@ -302,7 +303,7 @@ function ClearAttachments() { if ($info['session'] == -1) { $attached_file = "$hashed_attachment_dir/$info[localfilename]"; if (file_exists($attached_file)) { - unlink($attached_file); + unlink($attached_file); } } else { $rem_attachments[] = $info; @@ -367,11 +368,11 @@ function formatRecipientString($recipients, $item ) { function formatEnvheader($aMailbox, $passed_id, $passed_ent_id, $message, $color, $FirstTimeSee) { - global $msn_user_support, $default_use_mdn, $default_use_priority, + global $default_use_mdn, $default_use_priority, $show_xmailer_default, $mdn_user_support, $PHP_SELF, $javascript_on, - $squirrelmail_language; + $squirrelmail_language; - $mailbox = $aMailbox['NAME'] ; + $mailbox = $aMailbox['NAME']; $header = $message->rfc822_header; $env = array(); @@ -460,7 +461,7 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed global $base_uri, $draft_folder, $where, $what, $color, $sort, $startMessage, $PHP_SELF, $save_as_draft, $enable_forward_as_attachment, $imapConnection, $lastTargetMailbox, - $data_dir, $username, $delete_prev_next_display, + $username, $delete_prev_next_display, $compose_new_win, $javascript_on; //FIXME cleanup argument list, use $aMailbox where possible @@ -596,7 +597,7 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed // BEGIN MENU ROW - DELETE/REPLY/FORWARD/MOVE/etc. - $menu_row = ''; + $menu_row = ''; $comp_uri = $base_uri.'src/compose.php' . '?passed_id=' . $passed_id . '&mailbox=' . $urlMailbox . @@ -607,17 +608,20 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed $target = ''; $on_click=''; $method='method="post" '; + $onsubmit=''; if ($compose_new_win == '1') { if ( $javascript_on ) { $on_click=' onclick="comp_in_new_form(\''.$comp_uri.'\', this, this.form)"'; $comp_uri = 'javascript:void(0)'; $method='method="get" '; + $onsubmit = 'onsubmit="return false" '; } else { $target = 'target="_blank"'; } } - $menu_row .= "\n".'
'."\n"; + $menu_row .= "\n".''."\n"; // If Draft folder - create Resume link if (($mailbox == $draft_folder) && ($save_as_draft)) { @@ -630,11 +634,11 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed } // Show Alt URI for Draft/Sent if (isset($comp_alt_string)) - $menu_row .= getButton('SUBMIT', $new_button, $comp_alt_string, $on_click) . "\n"; + $menu_row .= getButton('submit', $new_button, $comp_alt_string, $on_click) . "\n"; - $menu_row .= getButton('SUBMIT', 'smaction_reply', _("Reply"), $on_click) . "\n"; - $menu_row .= getButton('SUBMIT', 'smaction_reply_all', _("Reply All"), $on_click) ."\n"; - $menu_row .= getButton('SUBMIT', 'smaction_forward', _("Forward"), $on_click); + $menu_row .= getButton('submit', 'smaction_reply', _("Reply"), $on_click) . "\n"; + $menu_row .= getButton('submit', 'smaction_reply_all', _("Reply All"), $on_click) ."\n"; + $menu_row .= getButton('submit', 'smaction_forward', _("Forward"), $on_click); if ($enable_forward_as_attachment) $menu_row .= '' . _("As Attachment") .'  '."\n"; @@ -648,10 +652,11 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed if (!(isset($passed_ent_id) && $passed_ent_id)) { $menu_row .= addHidden('mailbox', $aMailbox['NAME']); $menu_row .= addHidden('msg[0]', $passed_id); - $menu_row .= getButton('SUBMIT', 'delete', _("Delete")); + $menu_row .= addHidden('startMessage', $startMessage); + $menu_row .= getButton('submit', 'delete', _("Delete")); $menu_row .= '' . _("Bypass Trash"); } else { - $menu_row .= getButton('SUBMIT', 'delete', _("Delete"), '', FALSE) . "\n"; // delete button is disabled + $menu_row .= getButton('submit', 'delete', _("Delete"), '', FALSE) . "\n"; // delete button is disabled } $menu_row .= '
'; @@ -676,7 +681,7 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed } $menu_row .= ' '; - $menu_row .= getButton('SUBMIT', 'moveButton',_("Move")) . "\n" . ''; + $menu_row .= getButton('submit', 'moveButton',_("Move")) . "\n" . ''; } $menu_row .= ''; @@ -849,7 +854,7 @@ $header = $message->header; if (isset($sendreceipt)) { if ( !$message->is_mdnsent ) { $final_recipient = ''; - if ((isset($identity)) && ($identity != 0)) //Main identity + if ((isset($identity)) && ($identity != 0)) //Main identity $final_recipient = trim(getPref($data_dir, $username, 'email_address' . $identity, '' )); if ($final_recipient == '' ) $final_recipient = trim(getPref($data_dir, $username, 'email_address', '' )); @@ -879,7 +884,7 @@ $cnt = count($ent_ar); for ($i = 0; $i < $cnt; $i++) { $messagebody .= formatBody($imapConnection, $message, $color, $wrap_at, $ent_ar[$i], $passed_id, $mailbox); if ($i != $cnt-1) { - $messagebody .= '
'; + $messagebody .= '
'; } } @@ -955,5 +960,4 @@ sqimap_logout($imapConnection); $mailbox_cache[$aMailbox['NAME']] = $aMailbox; sqsession_register($mailbox_cache,'mailbox_cache'); ?> - - + \ No newline at end of file