|
|
@ -1033,17 +1033,21 @@ function rcmail_write_forward_attachments()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
global $RCMAIL, $COMPOSE, $MESSAGE;
|
|
|
|
global $RCMAIL, $COMPOSE, $MESSAGE;
|
|
|
|
|
|
|
|
|
|
|
|
$storage = $RCMAIL->get_storage();
|
|
|
|
|
|
|
|
$names = array();
|
|
|
|
|
|
|
|
$refs = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($MESSAGE->pgp_mime) {
|
|
|
|
if ($MESSAGE->pgp_mime) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$storage = $RCMAIL->get_storage();
|
|
|
|
|
|
|
|
$names = array();
|
|
|
|
|
|
|
|
$refs = array();
|
|
|
|
|
|
|
|
$size_errors = 0;
|
|
|
|
|
|
|
|
$size_limit = parse_bytes($RCMAIL->config->get('max_message_size'));
|
|
|
|
|
|
|
|
$total_size = 10 * 1024; // size of message body, to start with
|
|
|
|
|
|
|
|
|
|
|
|
$loaded_attachments = array();
|
|
|
|
$loaded_attachments = array();
|
|
|
|
foreach ((array)$COMPOSE['attachments'] as $attachment) {
|
|
|
|
foreach ((array)$COMPOSE['attachments'] as $attachment) {
|
|
|
|
$loaded_attachments[$attachment['name'] . $attachment['mimetype']] = $attachment;
|
|
|
|
$loaded_attachments[$attachment['name'] . $attachment['mimetype']] = $attachment;
|
|
|
|
|
|
|
|
$total_size += $attachment['size'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($COMPOSE['forward_uid'] == '*') {
|
|
|
|
if ($COMPOSE['forward_uid'] == '*') {
|
|
|
@ -1085,6 +1089,13 @@ function rcmail_write_forward_attachments()
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($size_limit && $size_limit < $total_size + $message->headers->size) {
|
|
|
|
|
|
|
|
$size_errors++;
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$total_size += $message->headers->size;
|
|
|
|
|
|
|
|
|
|
|
|
rcmail_save_attachment($message, null, $COMPOSE['id'], array('filename' => $name));
|
|
|
|
rcmail_save_attachment($message, null, $COMPOSE['id'], array('filename' => $name));
|
|
|
|
|
|
|
|
|
|
|
|
if ($message->headers->messageID) {
|
|
|
|
if ($message->headers->messageID) {
|
|
|
@ -1096,9 +1107,16 @@ function rcmail_write_forward_attachments()
|
|
|
|
if (count($refs) == 1) {
|
|
|
|
if (count($refs) == 1) {
|
|
|
|
$COMPOSE['reply_msgid'] = $refs[0];
|
|
|
|
$COMPOSE['reply_msgid'] = $refs[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!empty($refs)) {
|
|
|
|
if (!empty($refs)) {
|
|
|
|
$COMPOSE['references'] = implode(' ', $refs);
|
|
|
|
$COMPOSE['references'] = implode(' ', $refs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($size_errors) {
|
|
|
|
|
|
|
|
$limit = $RCMAIL->show_bytes($size_limit);
|
|
|
|
|
|
|
|
$error = $RCMAIL->gettext(array('name' => 'msgsizeerrorfwd', 'vars' => array('num' => $size_errors, 'size' => $limit)));
|
|
|
|
|
|
|
|
$RCMAIL->output->add_script(sprintf("%s.display_message('%s', 'error');", rcmail_output::JS_OBJECT_NAME, rcube::JQ($error)), 'docready');
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Saves an image as attachment
|
|
|
|
// Saves an image as attachment
|
|
|
|