From b6235ba024a4eeea8a7cb67a5b20b295bac80343 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 12 May 2015 09:06:08 +0000 Subject: [PATCH] reenabling the observance of the preference setting for forward as attachments; add notice to body that forwarded messagebody is found in attachments; add folder info in getAttachment calls when available --- mail/inc/class.mail_activesync.inc.php | 15 ++++++++------- mail/lang/egw_de.lang | 1 + mail/lang/egw_en.lang | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/mail/inc/class.mail_activesync.inc.php b/mail/inc/class.mail_activesync.inc.php index 6689608478..0498c6411b 100644 --- a/mail/inc/class.mail_activesync.inc.php +++ b/mail/inc/class.mail_activesync.inc.php @@ -676,8 +676,6 @@ class mail_activesync implements activesync_plugin_write, activesync_plugin_send // receive entire mail (header + body) // get message headers for specified message $headers = $this->mail->getMessageEnvelope($uid, $_partID, true, $folder); - // do forwarding as inline, until we understand why asmail fails - $preferencesArray['message_forwarding']='inline'; // build a new mime message, forward entire old mail as file if ($preferencesArray['message_forwarding'] == 'asmail') { @@ -685,6 +683,9 @@ class mail_activesync implements activesync_plugin_write, activesync_plugin_send $rawHeader = $this->mail->getMessageRawHeader($smartdata['itemid'], $_partID,$folder); $rawBody = $this->mail->getMessageRawBody($smartdata['itemid'], $_partID,$folder); $mailObject->AddStringAttachment($rawHeader.$rawBody, $headers['SUBJECT'].'.eml', 'message/rfc822'); + $AltBody = $AltBody."
".lang("See Attachments for Content of the Orignial Mail").$sigTextHtml; + $Body = $Body."\r\n".lang("See Attachments for Content of the Orignial Mail").$sigTextPlain; + $isforward = true; } else { @@ -1092,7 +1093,7 @@ class mail_activesync implements activesync_plugin_write, activesync_plugin_send break; default: $attachmentData = ''; - $attachmentData = $this->mail->getAttachment($id, $attachment['partID'],0,false); + $attachmentData = $this->mail->getAttachment($id, $attachment['partID'],0,false,false,$_folderName); $mailObject->AddStringAttachment($attachmentData['attachment'], $mailObject->EncodeHeader($attachment['name']), 'base64', $attachment['mimeType']); break; } @@ -1215,7 +1216,7 @@ class mail_activesync implements activesync_plugin_write, activesync_plugin_send // pass meeting requests to calendar plugin if (strtolower($attach['mimeType']) == 'text/calendar' && strtolower($attach['method']) == 'request' && isset($GLOBALS['egw_info']['user']['apps']['calendar']) && - ($attachment = $this->mail->getAttachment($id, $attach['partID'],0,false)) && + ($attachment = $this->mail->getAttachment($id, $attach['partID'],0,false,false,$_folderName)) && ($output->meetingrequest = calendar_activesync::meetingRequest($attachment['attachment']))) { $output->messageclass = "IPM.Schedule.Meeting.Request"; @@ -1316,7 +1317,7 @@ class mail_activesync implements activesync_plugin_write, activesync_plugin_send */ function GetAttachmentData($fid,$attname) { debugLog("getAttachmentData: $fid (attname: '$attname')"); - //error_log(__METHOD__.__LINE__." Fid: $fid (attname: '$attname')"); + error_log(__METHOD__.__LINE__." Fid: $fid (attname: '$attname')"); list($folderid, $id, $part) = explode(":", $attname); $this->splitID($folderid, $account, $folder); @@ -1324,7 +1325,7 @@ class mail_activesync implements activesync_plugin_write, activesync_plugin_send if (!isset($this->mail)) $this->mail = mail_bo::getInstance(false,self::$profileID,true,false,true); $this->mail->reopen($folder); - $attachment = $this->mail->getAttachment($id,$part,0,false); + $attachment = $this->mail->getAttachment($id,$part,0,false,false,$folder); print $attachment['attachment']; unset($attachment); return true; @@ -1350,7 +1351,7 @@ class mail_activesync implements activesync_plugin_write, activesync_plugin_send if (!isset($this->mail)) $this->mail = mail_bo::getInstance(false, self::$profileID,true,false,true); $this->mail->reopen($folder); - $att = $this->mail->getAttachment($id,$part,0,false); + $att = $this->mail->getAttachment($id,$part,0,false,false,$folder); $attachment = new SyncAirSyncBaseFileAttachment(); /* debugLog(__METHOD__.__LINE__.array2string($att)); diff --git a/mail/lang/egw_de.lang b/mail/lang/egw_de.lang index 63ac6820fc..8c7dcb6925 100644 --- a/mail/lang/egw_de.lang +++ b/mail/lang/egw_de.lang @@ -373,6 +373,7 @@ save: mail de Speichern saving of message %1 failed. destination folder %2 does not exist. mail de Speichern der Nachricht %1 ist fehlgeschlagen. Ziel Ordner %2 existiert nicht. saving of message %1 succeeded. check folder %2. mail de Speichern der Nachricht %1 war erfolgreich. Prüfen Sie den Ziel Ordner %2 saving the rule failed: mail de Speichern der Regel ist fehlgeschlagen: +see attachments for content of the orignial mail mail de Die Original Nachricht wurde als Anhang an diese e-Mail angehängt select all mail de Alle Auswählen select an existing entry in order to append mail content to it mail de Bestehendes Ticket auswählen, zu dem die Mail als Kommentar hinzugefügt werden soll. select file to attach to message mail de Wählen Sie die Dateien aus, die Sie an diese Nachricht anhängen möchten. diff --git a/mail/lang/egw_en.lang b/mail/lang/egw_en.lang index 45d9e4f76e..47f643d2c1 100644 --- a/mail/lang/egw_en.lang +++ b/mail/lang/egw_en.lang @@ -373,6 +373,7 @@ save: mail en Save: saving of message %1 failed. destination folder %2 does not exist. mail en Saving of message %1 failed. Destination Folder %2 does not exist. saving of message %1 succeeded. check folder %2. mail en Saving of message %1 succeeded. Check Folder %2. saving the rule failed: mail en Saving the rule failed: +see attachments for content of the orignial mail mail en See Attachments for Content of the Orignial Mail select all mail en Select all select an existing entry in order to append mail content to it mail en Select an existing entry in order to append mail content to it select file to attach to message mail en Select file to attach to message