Opened 7 years ago
Closed 6 years ago
#1484072 closed Bugs (fixed)
Weird forward behaviour.
| Reported by: | fjgm | Owned by: | thomasb |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.1-rc1 |
| Component: | PHP backend | Version: | git-master |
| Severity: | normal | Keywords: | forward attachment |
| Cc: |
Description
When forwarding mails with attachments, if the email is empty (no html or text body, just files attached) the attachment(s) is/are not included in the email being fowarded. I manage to fix this by removing an if condition.
File: ./program/steps/mail/compose.inc Function: rcmail_compose_body
// forward message body inline
else if ($compose_mode == RCUBE_COMPOSE_FORWARD)
{
$hasHtml = rcmail_has_html_part($MESSAGE['parts']);
if ($hasHtml && $CONFIG['htmleditor'])
{
$body = rcmail_first_html_part($MESSAGE);
$isHtml = true;
}
else
{
$body = rcmail_first_text_part($MESSAGE);
$isHtml = false;
}
//by commenting (removing) the if the problem is solved
/*if (strlen($body))*/
$body = rcmail_create_forward_body($body, $isHtml);
Change History (5)
comment:1 Changed 7 years ago by fjgm
comment:2 Changed 6 years ago by jpingle
- Milestone set to 0.1-rc1
comment:3 Changed 6 years ago by jpingle
See #1484050
comment:4 Changed 6 years ago by thomasb
- Keywords forward attachment added
- Owner set to thomasb
- Version set to svn-trunk
comment:5 Changed 6 years ago by thomasb
- Resolution set to fixed
- Status changed from new to closed
Fixed in [5cc4b13a]
Note: See
TracTickets for help on using
tickets.

The above allows the rcmail_create_forward_body to be called even if the body is empty, but also sometimes mails include only 1 part and that part is the attachment case in which roundcube also fails to attach the file(s) in the mail being forwarded; this can be fix by changing a condition in the rcmail_create_forward_body() function.
File: ./program/steps/mail/compose.inc Function: rcmail_create_forward_body
if (!isset($_SESSION['compose']['forward_attachments']) && is_array($MESSAGE['parts']) && sizeof($MESSAGE['parts'])>1) { rcmail_write_compose_attachments($MESSAGE); }Was replaced with:
if (!isset($_SESSION['compose']['forward_attachments']) && is_array($MESSAGE['parts'])) { rcmail_write_compose_attachments($MESSAGE); }