Author Topic: Roundcube 1.4-beta bad mail header in Sent mailbox when sending big attachment  (Read 706 times)

Offline Dunstan

  • Newbie
  • *
  • Posts: 2
I'm testing the Roundcube 1.4-beta, and a strange behaviour occurs when I send an email with a large (in my test it was 10MB) attachment. The mail is sent ok, but the Sent mailbox doesn't show the attachment in the message list, and if I try to open the mail, the following text is displayed: The message part is too big to process it. Download

The cause of this is that in the Sent mailbox, the message is saved with the following bad header:
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

instead of:
Content-Type: multipart/mixed;

I have tested the latest stable Roundcube version (1.3), and other IMAP mail program (Thunderbird) on the same IMAP-server, and the error occurs only when using Roundcube 1.4-beta. Messages with attachments greater than 4MB are affected, below 4MB everything seems to be normal.

Can somebody confirm this behaviour? If this is a configuration error on my behalf, please help!

« Last Edit: September 05, 2018, 07:35:37 AM by Dunstan »

Offline Dunstan

  • Newbie
  • *
  • Posts: 2
Further information:

This error can be due to bad memory management in Roundcube, probably in the mime encoding part.

I have found error messages in the log stating that

PHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 4604360 bytes) in ...roundcube/vendor/pear/mail_mime/Mail/mimePart.php on line 511

These error messages are probably unconnected to this problem, since there were no error messages during my tests, but I have raised the memory limit from 64M to 256M. Then I tested again, and the limit of files that I can send without bad headers in the Sent mailbox changed from around 4MB to around 12MB.

From this, the cause of the error should be that when encoding MIME for saving in the SENT mailbox, the program uses too much memory, and instead of encoding the attachment, it is simply saved as text in the message.

Please help! I can't raise PHP memory_limit much further.

I'm using PHP 7.2 and Roundcube 1.4-beta on Ubuntu 18.04, IMAP server: Dovecot
« Last Edit: October 05, 2018, 01:43:09 AM by Dunstan »