diff options
Diffstat (limited to 'program')
-rw-r--r-- | program/include/main.inc | 2 | ||||
-rw-r--r-- | program/include/rcube_imap.inc | 2 | ||||
-rw-r--r-- | program/include/rcube_smtp.inc | 2 | ||||
-rw-r--r-- | program/localization/de_CH/labels.inc | 3 | ||||
-rw-r--r-- | program/localization/de_CH/messages.inc | 4 | ||||
-rw-r--r-- | program/localization/de_DE/labels.inc | 3 | ||||
-rw-r--r-- | program/localization/de_DE/messages.inc | 4 | ||||
-rw-r--r-- | program/steps/mail/sendmail.inc | 48 |
8 files changed, 35 insertions, 33 deletions
diff --git a/program/include/main.inc b/program/include/main.inc index c5370b144..0a158dcb6 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -44,7 +44,7 @@ function rcmail_startup($task='mail') $CONFIG = is_array($rcmail_config) ? $rcmail_config : array(); // load host-specific configuration - rcmail_load_host_config(&$CONFIG); + rcmail_load_host_config($CONFIG); $CONFIG['skin_path'] = $CONFIG['skin_path'] ? preg_replace('/\/$/', '', $CONFIG['skin_path']) : 'skins/default'; diff --git a/program/include/rcube_imap.inc b/program/include/rcube_imap.inc index bf23f7165..dccd64fc9 100644 --- a/program/include/rcube_imap.inc +++ b/program/include/rcube_imap.inc @@ -990,7 +990,7 @@ class rcube_imap // append a mail message (source) to a specific mailbox - function save_message($mbox_name, $message) + function save_message($mbox_name, &$message) { $mailbox = $this->_mod_mailbox($mbox_name); diff --git a/program/include/rcube_smtp.inc b/program/include/rcube_smtp.inc index 63cdc1e58..3108675f5 100644 --- a/program/include/rcube_smtp.inc +++ b/program/include/rcube_smtp.inc @@ -49,7 +49,7 @@ $SMTP_CONN = null; * @return bool Returns TRUE on success, or FALSE on error * @access public */ -function smtp_mail($from, $recipients, $headers, &$body) +function smtp_mail($from, $recipients, &$headers, &$body) { global $SMTP_CONN, $CONFIG, $SMTP_ERROR; $smtp_timeout = null; diff --git a/program/localization/de_CH/labels.inc b/program/localization/de_CH/labels.inc index 9fa6c048c..9141564c0 100644 --- a/program/localization/de_CH/labels.inc +++ b/program/localization/de_CH/labels.inc @@ -37,7 +37,6 @@ $labels['inbox'] = 'Posteingang'; $labels['drafts'] = 'Entwürfe'; $labels['sent'] = 'Gesendet'; $labels['trash'] = 'Gelöscht'; -$labels['drafts'] = 'Vorlagen'; $labels['junk'] = 'Junk'; // message listing // Nachrichtenliste @@ -121,7 +120,7 @@ $labels['resetsearch'] = 'Löschen'; // message compose // Nachrichten erstellen $labels['compose'] = 'Neue Nachricht verfassen'; -$labels['savemessage'] = 'Außer diesem Entwurf'; +$labels['savemessage'] = 'Nachricht speichern'; $labels['sendmessage'] = 'Nachricht jetzt senden'; $labels['addattachment'] = 'Datei anfügen'; $labels['charset'] = 'Zeichensatz'; diff --git a/program/localization/de_CH/messages.inc b/program/localization/de_CH/messages.inc index 767b54f60..57c1513a2 100644 --- a/program/localization/de_CH/messages.inc +++ b/program/localization/de_CH/messages.inc @@ -38,9 +38,9 @@ $messages['sendingmessage'] = 'Nachricht wird gesendet...'; $messages['messagesent'] = 'Nachricht erfolgreich gesendet'; -$messages['savingmessage'] = 'Einsparunganzeige...'; +$messages['savingmessage'] = 'Nachricht wird gespeichert...'; -$messages['messagesaved'] = 'Anzeige gespeichert zu den Entwürfen'; +$messages['messagesaved'] = 'Nachricht als Entwurf gespeichert'; $messages['successfullysaved'] = 'Erfolgreich gespeichert'; diff --git a/program/localization/de_DE/labels.inc b/program/localization/de_DE/labels.inc index 00052c079..ac74b304a 100644 --- a/program/localization/de_DE/labels.inc +++ b/program/localization/de_DE/labels.inc @@ -38,7 +38,6 @@ $labels['inbox'] = 'Posteingang'; $labels['drafts'] = 'Entwürfe'; $labels['sent'] = 'Gesendet'; $labels['trash'] = 'Gelöscht'; -$labels['drafts'] = 'Entwürfe'; $labels['junk'] = 'Spam'; // message listing // Nachrichtenliste @@ -122,7 +121,7 @@ $labels['resetsearch'] = 'Löschen'; // message compose // Nachrichten erstellen $labels['compose'] = 'Neue Nachricht verfassen'; -$labels['savemessage'] = 'Außer diesem Entwurf'; +$labels['savemessage'] = 'Nachricht speichern'; $labels['sendmessage'] = 'Nachricht jetzt senden'; $labels['addattachment'] = 'Datei anfügen'; $labels['charset'] = 'Zeichensatz'; diff --git a/program/localization/de_DE/messages.inc b/program/localization/de_DE/messages.inc index 7eb90f9f7..622cd0d7d 100644 --- a/program/localization/de_DE/messages.inc +++ b/program/localization/de_DE/messages.inc @@ -40,9 +40,9 @@ $messages['sendingmessage'] = 'Nachricht wird gesendet...'; $messages['messagesent'] = 'Nachricht erfolgreich gesendet'; -$messages['savingmessage'] = 'Einsparunganzeige...'; +$messages['savingmessage'] = 'Nachricht wird gespeichert...'; -$messages['messagesaved'] = 'Anzeige gespeichert zu den Entwürfen'; +$messages['messagesaved'] = 'Nachricht als Entwurf gespeichert'; $messages['successfullysaved'] = 'Erfolgreich gespeichert'; diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc index 68e9fadd6..a57f2d4ed 100644 --- a/program/steps/mail/sendmail.inc +++ b/program/steps/mail/sendmail.inc @@ -62,15 +62,14 @@ function rcmail_get_identity($id) return FALSE; } -if (strlen($_POST['_draft_saveid']) > 3) { - $olddraftmessageid = $_POST['_draft_saveid']; -} -if (strlen($_POST['_draft_newsaveid']) > 3) { - $newdraftmessageid = $_POST['_draft_newsaveid']; -} -if ($_POST['_draft']) { - $savedraft = 1; -} +if (strlen($_POST['_draft_saveid']) > 3) + $olddraftmessageid = get_input_value('_draft_saveid', RCUBE_INPUT_POST); + +if (strlen($_POST['_draft_newsaveid']) > 3) + $newdraftmessageid = get_input_value('_draft_newsaveid', RCUBE_INPUT_POST); + +$savedraft = !empty($_POST['_draft']) ? TRUE : FALSE; + /****** check submission and compose message ********/ @@ -95,7 +94,7 @@ $mailto = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_to', R // decode address strings $to_address_arr = $IMAP->decode_address_list($mailto); -$identity_arr = rcmail_get_identity($_POST['_from']); +$identity_arr = rcmail_get_identity(get_input_value('_from', RCUBE_INPUT_POST)); $from = $identity_arr['mailto']; @@ -103,17 +102,19 @@ $first_to = is_array($to_address_arr[0]) ? $to_address_arr[0]['mailto'] : $mailt // try the message-id submitted by the compose form -if ($newdraftmessageid) { +if ($newdraftmessageid) $message_id = sprintf('<%s>',$newdraftmessageid); -} else { +else $message_id = sprintf('<%s@%s>', md5(uniqid('rcmail'.rand(),true)), $_SESSION['imap_host']); -} + +if (empty($identity_arr['string'])) + $identity_arr['string'] = $from; // compose headers array $headers = array('Date' => date('D, j M Y G:i:s O'), 'From' => $identity_arr['string'], - 'To' => rcube_charset_convert($mailto, $input_charset, $message_charset)); + 'To' => $mailto); // additional recipients if (!empty($_POST['_cc'])) @@ -218,7 +219,7 @@ $message_param = array('text_encoding' => $transfer_encoding, 'text_charset' => $message_charset); // compose message body and get headers -$msg_body = $MAIL_MIME->get($message_param); +$msg_body = &$MAIL_MIME->get($message_param); $msg_subject = $headers['Subject']; @@ -295,11 +296,10 @@ if (!$savedraft) { } // End of SMTP Delivery Block // Determine which folder to save message -if ($savedraft) { - $store_target = 'drafts_mbox'; -} else { - $store_target = 'sent_mbox'; -} +if ($savedraft) + $store_target = 'drafts_mbox'; +else + $store_target = 'sent_mbox'; if ($CONFIG[$store_target]) { @@ -311,10 +311,13 @@ if ($CONFIG[$store_target]) $store_folder = $IMAP->create_mailbox($CONFIG[$store_target], TRUE); else $store_folder = TRUE; + + // add headers to message body + $msg_body = $header_str."\r\n".$msg_body; // append message to sent box if ($store_folder) - $saved = $IMAP->save_message($CONFIG[$store_target], $header_str."\r\n".$msg_body); + $saved = $IMAP->save_message($CONFIG[$store_target], $msg_body); // raise error if saving failed if (!$saved) @@ -323,7 +326,8 @@ if ($CONFIG[$store_target]) 'file' => __FILE__, 'message' => "Could not save message in $CONFIG[$store_target]"), TRUE, FALSE); - if ($olddraftmessageid) { + if ($olddraftmessageid) + { // delete previous saved draft $a_deleteid = $IMAP->search($CONFIG['drafts_mbox'],'HEADER Message-ID',$olddraftmessageid); $deleted = $IMAP->delete_message($IMAP->get_uid($a_deleteid[0],$CONFIG['drafts_mbox']),$CONFIG['drafts_mbox']); |