$url_replytoallcc = '';
foreach( $url_replytoall_ar as $email => $personal) {
if ($personal) {
+ // if personal name contains address separator then surround
+ // the personal name with double quotes.
+ if (strpos($personal,',') !== false) {
+ $personal = '"'.$personal.'"';
+ }
$url_replytoallcc .= ", $personal <$email>";
} else {
$url_replytoallcc .= ', '. $email;
/**************** Only function definitions go below *************/
+function getforwardSubject($subject)
+{
+ if ((substr(strtolower($subject), 0, 4) != 'fwd:') &&
+ (substr(strtolower($subject), 0, 5) != '[fwd:') &&
+ (substr(strtolower($subject), 0, 6) != '[ fwd:')) {
+ $subject = '[Fwd: ' . $subject . ']';
+ }
+ return $subject;
+}
/* This function is used when not sending or adding attachments */
function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $session='') {
$bodypart = decodeBody($unencoded_bodypart,
$body_part_entity->header->encoding);
if ($type1 == 'html') {
- $bodypart = str_replace(array(' ','>','<'),array(' ','<','>'),$bodypart);
+ $bodypart = str_replace(array(' ','>','<'),array(' ','<','>'),$bodypart);
$bodypart = strip_tags($bodypart);
}
if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
break;
case ('forward'):
$send_to = '';
- $subject = decodeHeader($orig_header->subject,false,true);
- if ((substr(strtolower($subject), 0, 4) != 'fwd:') &&
- (substr(strtolower($subject), 0, 5) != '[fwd:') &&
- (substr(strtolower($subject), 0, 6) != '[ fwd:')) {
- $subject = '[Fwd: ' . $subject . ']';
- }
+ $subject = getforwardSubject(decodeHeader($orig_header->subject,false,true));
$body = getforwardHeader($orig_header) . $body;
sqUnWordWrap($body);
$composeMessage = getAttachments($message, $composeMessage, $passed_id, $entities, $imapConnection);
$body = "\n" . $body;
break;
case ('forward_as_attachment'):
+ $subject = getforwardSubject(decodeHeader($orig_header->subject,false,true));
$composeMessage = getMessage_RFC822_Attachment($message, $composeMessage, $passed_id, $passed_ent_id, $imapConnection);
$body = '';
break;
switch ($message->type0) {
case 'message':
if ($message->type1 == 'rfc822') {
- $filename = $message->rfc822_header->subject.'.eml';
+ $filename = $message->rfc822_header->subject;
if ($filename == "") {
- $filename = "untitled-".$message->entity_id.'.eml';
+ $filename = "untitled-".$message->entity_id;
}
+ $filename .= '.msg';
} else {
$filename = $message->getFilename();
}
$filename = $message->getFilename();
break;
}
- $filename = decodeHeader($filename);
+ $filename = str_replace(' ', ' ', decodeHeader($filename));
if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) {
$filename = $languages[$squirrelmail_language]['XTRA_CODE']('encode', $filename);
$fp = fopen($full_localfilename, 'w');
fwrite ($fp, $body);
fclose($fp);
- $composeMessage->initAttachment('message/rfc822',$subject.'.eml',
+ $composeMessage->initAttachment('message/rfc822',$subject.'.msg',
$full_localfilename);
}
return $composeMessage;
if ($compose_new_win == '1') {
echo ' <TR>' . "\n" .
' <TD BGCOLOR="' . $color[0] . '" COLSPAN=2 ALIGN=CENTER>' . "\n" .
- ' <TEXTAREA NAME=body ROWS=20 COLS="' .
+ ' <TEXTAREA NAME=body ID=body ROWS=20 COLS="' .
$editor_size . '" WRAP="VIRTUAL">';
}
else {
echo ' <TR>' . "\n" .
' <TD BGCOLOR="' . $color[4] . '" COLSPAN=2>' . "\n" .
- ' <TEXTAREA NAME=body ROWS=20 COLS="' .
+ ' <TEXTAREA NAME=body ID=body ROWS=20 COLS="' .
$editor_size . '" WRAP="VIRTUAL">';
}
ClearAttachments($composeMessage);
if ($action == 'reply' || $action == 'reply_all') {
sqimap_mailbox_select ($imap_stream, $mailbox);
- sqimap_messages_flag ($imap_stream, $passed_id, $passed_id, 'Answered', true);
+ sqimap_messages_flag ($imap_stream, $passed_id, $passed_id, 'Answered', false);
}
sqimap_logout($imap_stream);
}