From e0b9fadfdda71e91bd9beb7c2e81b97a8fa5445b Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Thu, 3 Jul 2014 10:16:23 +0000 Subject: [PATCH] * Mail/Infolog/Tracker: fix problem with converting mail to infolog/tracker entries, when forwarded messages are attached (message/rfc822 attachments) --- infolog/inc/class.infolog_ui.inc.php | 6 +++++- mail/inc/class.mail_compose.inc.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/infolog/inc/class.infolog_ui.inc.php b/infolog/inc/class.infolog_ui.inc.php index 25d055257d..d27069b687 100644 --- a/infolog/inc/class.infolog_ui.inc.php +++ b/infolog/inc/class.infolog_ui.inc.php @@ -2492,6 +2492,7 @@ class infolog_ui $attachments[] = array( 'name' => trim($subject).'.eml', 'mimeType' => 'message/rfc822', + 'type' => 'message/rfc822', 'tmp_name' => $attachment_file, 'size' => $size, ); @@ -2512,6 +2513,7 @@ class infolog_ui $attachments[] = array( 'name' => $attachment['name'], 'mimeType' => $attachment['type'], + 'type' => $attachment['type'], 'tmp_name' => $attachment['file'], 'size' => $attachment['size'], ); @@ -2533,6 +2535,7 @@ class infolog_ui $attachments[] = array( 'name' => trim($subject).'.eml', 'mimeType' => 'message/rfc822', + 'type' => 'message/rfc822', 'tmp_name' => $attachment_file, 'size' => $size, ); @@ -2569,7 +2572,6 @@ class infolog_ui $mailobject->reopen($mailbox); $mailcontent = $mailClass::get_mailcontent($mailobject,$uid,$partid,$mailbox,false,true,(!($GLOBALS['egw_info']['user']['preferences'][$sessionLocation]['saveAsOptions']==='text_only'))); - // this one adds the mail itself (as message/rfc822 (.eml) file) to the infolog as additional attachment // this is done to have a simple archive functionality (ToDo: opening .eml in email module) if ($GLOBALS['egw_info']['user']['preferences'][$sessionLocation]['saveAsOptions']==='add_raw') @@ -2585,10 +2587,12 @@ class infolog_ui $mailcontent['attachments'][] = array( 'name' => trim($subject).'.eml', 'mimeType' => 'message/rfc822', + 'type' => 'message/rfc822', 'tmp_name' => $attachment_file, 'size' => $size, ); } +//_debug_array($mailcontent); return $this->edit($this->bo->import_mail( $mailcontent['mailaddress'], $mailcontent['subject'], diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php index 669bd68730..725a445be5 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -1705,7 +1705,7 @@ class mail_compose $size = lang('unknown'); $this->addMessageAttachment($_uid, $_partID, $_folder, - $mail_bo->decode_header(($headers['SUBJECT']?$headers['SUBJECT']:lang('no subject'))), + $mail_bo->decode_header(($headers['SUBJECT']?$headers['SUBJECT']:lang('no subject'))).'.eml', 'MESSAGE/RFC822', $size); } else