From: ("")
Date:  22 Feb 2018 03:51:31 Hong Kong Time

[PEAR-BUG] Bug #21215 [Com]: "multipart/signed" messages decoding issue

NNTP-Posting-Host:  null

Edit report at

 ID:               21215
 Comment by:       slgundam at gmail dot com
 Reported By:      sgironella at schema31 dot it
 Summary:          "multipart/signed" messages decoding issue
 Status:           Open
 Type:             Bug
 Package:          Mail_mimeDecode
 Operating System: FreeBSD 11
 Package Version:  1.5.6
 PHP Version:      5.6.30
 Roadmap Versions: 
 New Comment:

Roundcube could also fix this by adding an extra check in
decode_raw_message to check this before calling getMimeNumbers

in EmailReporting i fixed it like this

Previous Comments:

[2017-06-01 03:21:42] sgironella

Added #patch


[2017-06-01 03:06:48] alan_k

Can you suggest a patch


[2017-05-31 09:11:31] sgironella

On "multipart/signed" messages, "_decode()" method  doesn't return a
parts list but an associative array ("msg_body", "sig_hdr", "sig_body");
this lead "getMimeNumbers()" method to an infinite loop as it expects to
iterate over a parts list and it doesn't manage those keys.

See the case "case 'multipart/signed': // PGP" at line 324

Actual result:
[31-May-2017 12:41:33 Europe/Rome] PHP Fatal error:  Allowed memory size
of 134217728 bytes exhausted (tried to allocate 72 bytes) in
/webroot/vendor/ on
line 425
[31-May-2017 12:41:33 Europe/Rome] PHP Stack trace:
[31-May-2017 12:41:33 Europe/Rome] PHP   1. {main}()
[31-May-2017 12:41:33 Europe/Rome] PHP   2. include_once()
[31-May-2017 12:41:33 Europe/Rome] PHP   3. rcube_message->__construct()
[31-May-2017 12:41:33 Europe/Rome] PHP   4. rcube_dbmail->get_message()
[31-May-2017 12:41:33 Europe/Rome] PHP   5.
[31-May-2017 12:41:33 Europe/Rome] PHP   6.
[31-May-2017 12:41:33 Europe/Rome] PHP   7.
[31-May-2017 12:41:33 Europe/Rome] PHP   8.


Edit this bug report at