Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message with attachment, but without message causes php crash #7588

Closed
Hallikas opened this issue Sep 4, 2020 · 1 comment
Closed

Message with attachment, but without message causes php crash #7588

Hallikas opened this issue Sep 4, 2020 · 1 comment

Comments

@Hallikas
Copy link

Hallikas commented Sep 4, 2020

Version: GIT/master, Latest commit: 5264534

2020/09/04` 22:00:28 [error] 30840#30840: *3644 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Cannot access protected
property rcube_message::$body in /data/www/roundcube/program/steps/mail/show.inc:722
Stack trace:
#0 /data/www/roundcube/program/include/rcmail_output_html.php(1374): rcmail_message_body(Array)
#1 [internal function]: rcmail_output_html->xml_command(Array)
#2 /data/www/roundcube/program/include/rcmail_output_html.php(1224): preg_replace_callback('/<roundcube:([-...', Array, '<roundcube:obje...')
#3 /data/www/roundcube/program/include/rcmail_output_html.php(782): rcmail_output_html->parse_xml('<roundcube:obje...')
#4 /data/www/roundcube/program/include/rcmail_output_html.php(615): rcmail_output_html->parse('message', false)
#5 /data/www/roundcube/program/steps/mail/show.inc(177): rcmail_output_html->send('message', false)
#6 /data/www/roundcube/index.php(311): include_once('/data/www/round...')
#7 /data/www/roundcube/public_html/index.php(26): include('/data/www/round...')
#8 {main}
thrown in /data/www/roundcube/program/steps/mail/sho" while reading response header from upstream

I debugged that if mail has only 1 MIME part (attachment), it would cause that error. If message part is added, mail works.

mbox content to test:

From someone@nobody.net  Fri Sep 04 20:58:26 2020
Received: from localhost by localhost with LMTP id KAoFLUKAUl9gfQAA0J78UA for <someone@nobody.net>; Fri, 04 Sep 2020 20:58:26 +0300
From: Good Guy <test@nobody.net>
To: <someone@nobody.net>
Subject: Not Working
Date: Fri, 04 Sep 2020 20:58:26 +0300
Content-Type: multipart/mixed; boundary="=_434296447f9493d19fd80dd0842ba64f"
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0
X-IMAPbase: 1599246023 0000000002
X-UID: 1
Status: O


--=_434296447f9493d19fd80dd0842ba64f
Content-Transfer-Encoding: base64
Content-Type: application/pdf; name=dummy.pdf
Content-Disposition: attachment; filename=dummy.pdf

JVBERi0xLjQKJSVFT0YK==
--=_434296447f9493d19fd80dd0842ba64f--

From someone@nobody.net  Fri Sep 04 20:56:00 2020
Received: from localhost by localhost with LMTP id oGSVC4ApTV+ZYQAA0J78UA for <someone@nobody.net>; Mon, 31 Aug 2020 19:46:56 +0300
From: Good Guy <test@nobody.net>
To: <someone@nobody.net>
Subject: Working
Date: Fri, 04 Sep 2020 20:56:00 +0300
Content-Type: multipart/mixed; boundary="=_434296447f9493d19fd80dd0842ba64f"
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0
X-UID: 2
Status: RO


--=_434296447f9493d19fd80dd0842ba64f
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII; format=flowed


--=_434296447f9493d19fd80dd0842ba64f
Content-Transfer-Encoding: base64
Content-Type: application/pdf; name=dummy.pdf
Content-Disposition: attachment; filename=dummy.pdf

JVBERi0xLjQKJSVFT0YK==
--=_434296447f9493d19fd80dd0842ba64f--
@alecpl
Copy link
Member

alecpl commented Sep 5, 2020

Fixed.

@alecpl alecpl closed this as completed Sep 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants