roundcube / roundcubemail

The Roundcube Webmail suite
https://roundcube.net
GNU General Public License v3.0
5.79k stars 1.62k forks source link

not MIME encoding outgoing emails correctly #1955

Closed rcubetrac closed 15 years ago

rcubetrac commented 15 years ago

Reported by ldeviator on 18 Nov 2008 23:06 UTC as Trac ticket #1485571

trunk is sending out malformed messages unreadable in Thunderbird . I think the MIME encoding of the message body is incorrect, but I haven't been able to track it down yet.

Notice the double MIME version header too.

example:

To: Nick Mossie ld@initiated.com Subject: test MIME-Version: 1.0 Date: Tue, 18 Nov 2008 15:51:43 -0600 From: Nick Mossie nick@tempstop.net Organization: Temp-Stop, LLC Message-ID: 9f4e49886db6fd74cae64f3c11c74b6d@exchange.tempstop.net X-Sender: nick@tempstop.net User-Agent: RoundCube Webmail/0.2-beta Content-Type: multipart/alternative; boundary="=_75f8055a556489a806d21809dcadbebd" Mime-Version: 1.0 Content-Transfer-Encoding: BASE64

LS09Xzc1ZjgwNTVhNTU2NDg5YTgwNmQyMTgwOWRjYWRiZWJkCkNvbnRlbnQtVHJhbnNmZXItRW5j b2Rpbmc6IDhiaXQKQ29udGVudC1UeXBlOiB0ZXh0L3BsYWluOyBjaGFyc2V0PSJVVEYtOCIKCgoK dGVzdCAgCgpOaWNrIE1vc3NpZQpJbmZvcm1hdGlvbiBUZWNobm9sb2d5ClRlbXAtU3RvcCwgTExD CjMzMSBOVyBDYXBpdGFsIERyaXZlCkxlZSdzIFN1bW1pdCwgTU8gNjQwODYKKDgxNikgNTU0IC0g MzM1MgpGYXggOiAoODE2KSA1NTQtNjU1NgpFbWFpbCA6IG5pY2tAdGVtcHN0b3AubmV0IFsxXQoK VGhpcyBtZXNzYWdlIGlzIGZyb20gdGhlIG9mZmljZSBvZiBUZW1wIFN0b3AgTExDLCBhbmQgaXMg aW50ZW5kZWQgb25seSBmb3IKdGhlIGFkZHJlc3NlZS4gVGhlIGluZm9ybWF0aW9uIGNvbnRhaW5l ZCBpbiB0aGlzIG1lc3NhZ2UgaXMgY29uZmlkZ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gYW5kIG5vdGlmeSB0aGUgc2VuZGVyIG9mID0KdGhlIGRlbGl2ZXJ5IGVycm9yIGJ5 IHJldHVybiBlLW1haWwgb3IgeW91IG1heSBjYWxsIG91ciBvZmZpY2UgYXQgKDgxNikgNTU0PQot MzM1Mi48YnIgLz48YnIgLz5UaGFuayB5b3UuPC9wPgo8L2Rpdj4KLS09Xzc1ZjgwNTVhNTU2NDg5 YTgwNmQyMTgwOWRjYWRiZWJkLS0K --=_75f8055a556489a806d21809dcadbebd--

which when decoded looks like this:

To: Nick Mossie ld@initiated.com Subject: test MIME-Version: 1.0 Date: Tue, 18 Nov 2008 15:51:43 -0600 From: Nick Mossie nick@tempstop.net Organization: Temp-Stop, LLC Message-ID: 9f4e49886db6fd74cae64f3c11c74b6d@exchange.tempstop.net X-Sender: nick@tempstop.net User-Agent: RoundCube Webmail/0.2-beta Content-Type: multipart/alternative; boundary="=_75f8055a556489a806d21809dcadbebd" Mime-Version: 1.0 Content-Transfer-Encoding: BASE64

--=_75f8055a556489a806d21809dcadbebd Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="UTF-8"

test

Nick Mossie Information Technology Temp-Stop, LLC 331 NW Capital Drive Lee's Summit, MO 64086 (816) 554 - 3352 Fax : (816) 554-6556 Email : nick@tempstop.net [message is from the office of Temp Stop LLC, and is intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under federal or state securities laws and is intended only for the use of the addressee.

Unauthorized forwarding, printing, copying, distributing, or using of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by return e-mail or you may call our office at (816) 554-3352.

Thank you.

Links:

[1](1]

This) mailto:nick@tempstop.net

--=_75f8055a556489a806d21809dcadbebd Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="UTF-8"

<p style=3D"text-align: left;">test

Nick Mossie
Information Technology
Temp-Stop, LLC
331 NW Capital Drive
= Lee's Summit, MO 64086
(816) 554 - 3352
Fax : (816) 554-6556
Email : nick@tempstop.net
3D""
This message is from the office of Temp Stop LLC, and is intended only fo= r the addressee. The information contained in this message is confidential = and may constitute inside or non-public information under federal or state = securities laws and is intended only for the use of the addressee.
Unauthorized forwarding, printing, copying, distributing, or using of su= ch information is strictly prohibited and may be unlawful. If you are not t= he addressee, please promptly delete this message and notify the sender of = the delivery error by return e-mail or you may call our office at (816) 554= -3352.

Thank you.

--=75f8055a556489a806d21809dcadbebd-- \377\276\363Nyk\236z\343\317Z\363N\235\333_4\365\327^Zu\267\233

the same message from the released 0.2-beta, which is not MIME encoded

MIME-Version: 1.0 Date: Tue, 18 Nov 2008 16:36:25 -0600 From: Nick Mossie nick@tempstop.net To: ld@initiated.com Subject: beta test Organization: Temp-Stop, LLC Message-ID: 11dc47ed1f504164d176ae2ff97d66ef@tempstop.com X-Sender: nick@tempstop.net User-Agent: RoundCube Webmail/0.2-beta Content-Type: multipart/alternative; boundary="=_f66da144518fb74b6c9302dde0d8da31"

--=_f66da144518fb74b6c9302dde0d8da31 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="UTF-8"

test

Nick Mossie Information Technology Temp-Stop, LLC 331 NW Capital Drive Lee's Summit, MO 64086 (816) 554 - 3352 Fax : (816) 554-6556 Email : nick@tempstop.net [message is from the office of Temp Stop LLC, and is intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under federal or state securities laws and is intended only for the use of the addressee.

Unauthorized forwarding, printing, copying, distributing, or using of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by return e-mail or you may call our office at (816) 554-3352.

Thank you.

Links:

[1](1]

This) mailto:nick@tempstop.net

--=_f66da144518fb74b6c9302dde0d8da31 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="UTF-8"

test

Nick Mossie
Information Technology
Temp-Stop, LLC
331 NW Capital Drive
= Lee's Summit, MO 64086
(816) 554 - 3352
Fax : (816) 554-6556
Email : nick@tempstop.net
3D""
This message is from the office of Temp Stop LLC, and is intended only fo= r the addressee. The information contained in this message is confidential = securities laws and is intended only for the use of the addressee.
Unauthorized forwarding, printing, copying, distributing, or using of su= ch information is strictly prohibited and may be unlawful. If you are not t= he addressee, please promptly delete this message and notify the sender of = the delivery error by return e-mail or you may call our office at (816) 554= -3352.

Thank you.

--=_f66da144518fb74b6c9302dde0d8da31--

Migrated-From: http://trac.roundcube.net/ticket/1485571

rcubetrac commented 15 years ago

Comment by ldeviator on 18 Nov 2008 23:12 UTC

sorry for the ugly pasting, I've attached the messages in files

rcubetrac commented 15 years ago

Comment by @alecpl on 19 Nov 2008 08:37 UTC

Works for me. Please, write steps to reproduce and describe your environment.

rcubetrac commented 15 years ago

Owner changed by @alecpl on 19 Nov 2008 08:37 UTC

=> none

rcubetrac commented 15 years ago

Comment by ldeviator on 19 Nov 2008 16:45 UTC

get trunk from http://trac.roundcube.net/changeset/latest/trunk/?old_path=%2F&format=zip

use main.inc.php.txt from above (if I should post my DB file too I can)

send an HTML message

message is unreadable in Thunderbird.. nothing besides message headers show up

mutt can't read it correctly either... the base64message_decoded.txt is what it looks like in mutt

rcubetrac commented 15 years ago

Comment by ldeviator on 19 Nov 2008 16:49 UTC

use flags for PHP

[ Found these USE variables for dev-lang/php-5.2.6-20a1b3a0 ] U I

rcubetrac commented 15 years ago

Comment by ldeviator on 20 Nov 2008 19:01 UTC

I tracked this down... this happens if you use the php mail() function in my setup, which happens if you leave the $rcmail_config['smtp_server'] blank

so, this is not a roundcube problem, but some kinda crazy PHP problem

PHP mail() will add the header

MIME-version: 1.0 Content-Transfer-Encoding: BASE64

and then base64 encode the mailbody, but leave the ending boundry in place

so note that using the php mail() function is not an option with a similar setup (all gentoo users beware!) because it will lead to malformed outgoing messages

rcubetrac commented 15 years ago

Comment by ldeviator on 20 Nov 2008 19:05 UTC

extra headers actually:

Mime-Version: 1.0
Content-Transfer-Encoding: BASE64
rcubetrac commented 15 years ago

Comment by ldeviator on 20 Nov 2008 19:12 UTC

it's an mbstring issue in PHP

http://bugs.php.net/bug.php?id=30766

for roundcube, overloading mail() is no good ... I had mine set to 7 left over from RedHat days

in the .htaccess that comes with roundcube, maybe adding this would be a good idea...

php_value       mbstring.func_overload  0
rcubetrac commented 15 years ago

Comment by @alecpl on 21 Nov 2008 09:32 UTC

Added .htaccess entry in e86ff945.

rcubetrac commented 15 years ago

Status changed by @alecpl on 21 Nov 2008 09:32 UTC

new => closed