X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fread_body.php;h=3f0f0bbe8ebf805a98678772dd46d978ec841249;hb=9d9430d6b34c5157d887bbfdbcfba6b17a48acd3;hp=0aa2c9ef5b46366ec484ab9e161a3f671532bef6;hpb=54817114a34450766c7d5967fbc409b4136de8a6;p=squirrelmail.git diff --git a/src/read_body.php b/src/read_body.php index 0aa2c9ef..3f0f0bbe 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -139,22 +139,8 @@ function printer_friendly_link() { } function ServerMDNSupport( $read ) { - - $num = 0; - $resp = ''; - while ($num < count($read) ) { - $resp .= $read[$num]; - $num++; - } - $read[] = split(' * ', $resp); - $num = 0; - $ret = FALSE; - while ( !$ret && $num < count($read) ) { - if ( ereg('PERMANENTFLAGS', $read[$num] ) ) { - $ret = ( ereg('mdnsent',strtolower($read[$num]) ) || ereg("\\\*", $read[$num] ) ); - } - $num++; - } + /* escaping $ doesn't work -> \x36 */ + $ret = preg_match( '/(\x36MDNSent|\\\*)/i', $read ); return ( $ret ); } @@ -162,9 +148,7 @@ function SendMDN ( $recipient , $sender) { global $imapConnection, $mailbox, $username, $attachment_dir, $SERVER_NAME, $version, $attachments, $identity, $data_dir, $passed_id; - $message = sqimap_get_message($imapConnection, $passed_id, $mailbox); - $header = $message->header; - + $header = sqimap_get_message_header($imapConnection, $passed_id, $mailbox); $hashed_attachment_dir = getHashedDir($username, $attachment_dir); // part 1 (RFC2298) @@ -185,12 +169,7 @@ function SendMDN ( $recipient , $sender) { "\t" . _("Sent:") . ' ' . $senton . "\r\n" . "\r\n" . sprintf( _("Was displayed on %s"), $now ); -/* - $body = sprintf( _("This message sent on %s to %s with subject \"%s\" has been displayed on %s."), - $senton, $to, $subject, $now ) . - "\r\n" . - _("This is no guarantee that the message has been read or understood.") . "\r\n"; -*/ + // part2 (RFC2298) $original_recipient = $to; @@ -226,20 +205,13 @@ function SendMDN ( $recipient , $sender) { function ToggleMDNflag ( $set ) { - global $imapConnection, $passed_id, $mailbox; - - if ( $set ) { - $sg = '+'; - - } else { - $sg = '-'; - } - - $cmd = 'STORE ' . $passed_id . ' ' . $sg . 'FLAGS ($MDNSent)'; sqimap_mailbox_select($imapConnection, $mailbox); - $read = sqimap_run_command ($imapConnection, $cmd, true, $response, $readmessage); - + + $sg = $set?'+':'-'; + $cmd = 'STORE ' . $passed_id . ' ' . $sg . 'FLAGS ($MDNSent)'; + $read = sqimap_run_command ($imapConnection, $cmd, true, $response, + $readmessage); } function ClearAttachments() { @@ -268,8 +240,11 @@ function ClearAttachments() { $passed_id */ +if ( isset( $mailbox ) ) { + $mailbox = urldecode( $mailbox ); +} $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); -$read = sqimap_mailbox_select($imapConnection, $mailbox); +$read = sqimap_mailbox_select($imapConnection, $mailbox, false, false, true); do_hook('html_top'); @@ -279,7 +254,7 @@ do_hook('html_top'); if( $default_use_mdn && ( $mdn_user_support = getPref($data_dir, $username, 'mdn_user_support', $default_use_mdn) ) ) { - $supportMDN = ServerMDNSupport($read); + $supportMDN = ServerMDNSupport($read["PERMANENTFLAGS"]); $flags = sqimap_get_flags ($imapConnection, $passed_id); $FirstTimeSee = !(in_array( 'Seen', $flags )); } @@ -518,6 +493,9 @@ if (isset ($message->header->cc[0]) && trim($message->header->cc[0])) { } } } +else { + $cc_string = ''; +} /** FORMAT THE BCC STRING **/ $i = 0; @@ -559,6 +537,9 @@ if (isset ($message->header->bcc[0]) && trim($message->header->bcc[0])){ } } } +else { + $bcc_string = ''; +} if ($default_use_priority) { $priority_level = substr($message->header->priority,0,1); @@ -619,7 +600,11 @@ if ($where && $what) { echo _("Delete") . ' '; if (($mailbox == $draft_folder) && ($save_as_draft)) { echo '| ". + "src/compose.php?mailbox=$mailbox&send_to=$to_string&send_to_cc=$cc_string&send_to_bcc=$bcc_string&subject=$url_subj&draft_id=$passed_id&ent_num=$ent_num\""; + if ($compose_new_win == '1') { + echo 'TARGET="compose_window" onClick="comp_in_new()"'; + } + echo '>'. _("Resume Draft") . ''; } @@ -656,17 +641,29 @@ echo '' . '' . '" . + ."mailbox=$urlMailbox&ent_num=$ent_num\""; + if ($compose_new_win == '1') { + echo 'TARGET="compose_window" onClick="comp_in_new()"'; + } + echo '>'. _("Forward") . ' | ' . '" . + "reply_id=$passed_id&mailbox=$urlMailbox&ent_num=$ent_num\""; + if ($compose_new_win == '1') { + echo 'TARGET="compose_window" onClick="comp_in_new()"'; + } + echo '>'. _("Reply") . ' | ' . '" . + "reply_id=$passed_id&mailbox=$urlMailbox&ent_num=$ent_num\""; + if ($compose_new_win == '1') { + echo 'TARGET="compose_window" onClick="comp_in_new()"'; + } + echo '>'. _("Reply All") . ' ' . '' . @@ -732,7 +729,7 @@ echo "