| | |
| | | |
| | | if (!empty($MESSAGE->parts)) { |
| | | // collect IDs of message/rfc822 parts |
| | | if ($compose_mode == RCUBE_COMPOSE_EDIT || $compose_mode == RCUBE_COMPOSE_DRAFT) { |
| | | foreach ($MESSAGE->attachments as $part) { |
| | | if ($part->mimetype == 'message/rfc822') { |
| | | $messages[] = $part->mime_id; |
| | | } |
| | | foreach ($MESSAGE->mime_parts as $part) { |
| | | if ($part->mimetype == 'message/rfc822') { |
| | | $messages[] = $part->mime_id; |
| | | } |
| | | } |
| | | |
| | |
| | | continue; |
| | | } |
| | | |
| | | // skip all content parts inside the message/rfc822 part in DRAFT/EDIT mode |
| | | // skip all content parts inside the message/rfc822 part |
| | | foreach ($messages as $mimeid) { |
| | | if (strpos($part->mime_id, $mimeid . '.') === 0) { |
| | | continue 2; |
| | |
| | | $messages = array(); |
| | | |
| | | foreach ((array)$message->mime_parts as $pid => $part) { |
| | | if ($part->mimetype == 'message/rfc822') { |
| | | $messages[] = $part->mime_id; |
| | | } |
| | | |
| | | if ($part->disposition == 'attachment' || ($part->disposition == 'inline' && $bodyIsHtml) || $part->filename) { |
| | | // skip parts that aren't valid attachments |
| | | if ($part->ctype_primary == 'multipart' || $part->mimetype == 'application/ms-tnef') { |
| | |
| | | continue; |
| | | } |
| | | |
| | | // skip message/rfc822 attachments on forwards (#1489214) |
| | | // Thunderbird when forwarding in inline mode displays such attachments |
| | | // and skips any attachments from inside of such part, this however |
| | | // skipped e.g. images used in HTML body or other attachments. So, |
| | | // better to skip .eml attachments but not their content (included files). |
| | | if ($part->mimetype == 'message/rfc822') { |
| | | if ($compose_mode == RCUBE_COMPOSE_FORWARD) { |
| | | continue; |
| | | } |
| | | $messages[] = $part->mime_id; |
| | | } |
| | | else if ($compose_mode != RCUBE_COMPOSE_FORWARD) { |
| | | // skip attachments included in message/rfc822 attachment (#1486487) |
| | | foreach ($messages as $mimeid) { |
| | | if (strpos($part->mime_id, $mimeid . '.') === 0) { |
| | | continue 2; |
| | | } |
| | | // skip attachments included in message/rfc822 attachment (#1486487, #1490607) |
| | | foreach ($messages as $mimeid) { |
| | | if (strpos($part->mime_id, $mimeid . '.') === 0) { |
| | | continue 2; |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | global $RCMAIL, $COMPOSE; |
| | | |
| | | $cid_map = array(); |
| | | $cid_map = array(); |
| | | $messages = array(); |
| | | |
| | | foreach ((array)$message->mime_parts as $pid => $part) { |
| | | if ($part->mimetype == 'message/rfc822') { |
| | | $messages[] = $part->mime_id; |
| | | } |
| | | |
| | | if (($part->content_id || $part->content_location) && $part->filename) { |
| | | // skip attachments included in message/rfc822 attachment (#1486487, #1490607) |
| | | foreach ($messages as $mimeid) { |
| | | if (strpos($part->mime_id, $mimeid . '.') === 0) { |
| | | continue 2; |
| | | } |
| | | } |
| | | |
| | | if ($attachment = rcmail_save_attachment($message, $pid)) { |
| | | $COMPOSE['attachments'][$attachment['id']] = $attachment; |
| | | $url = sprintf('%s&_id=%s&_action=display-attachment&_file=rcmfile%s', |