Discussion:
[RCD] RC 1.2 - Corrupted e-mail headers while sending an html empty message
s***@schema31.it
2016-07-14 13:08:57 UTC
Permalink
Hello all,
I've recently posted a bug reporting to the Roundcube community forum
[1]
We have noticed a strange behavior with a fresh Roundcube 1.2 install
(no additional plugins enabled nor 'strange' custom config defined).

To reproduce this, send an e-mail using the html editor, leaving a blank
content.

Received e-mail has a 'text/html' content-type (instead of the expected
'multipart'). therefore client view raw mime-parts as e-mail content.

Note that sent e-mail (taken from sender 'sent' mailbox) has the right
content-type (multipart) so it's perfectly readable.

In addition, we have recorded a tcpdump session, that confirm our
impression of having two separate libraries handling in a different way
SMPT (for delivery) and IMAP (for storing e-mail within 'sent' inbox)
sections; that's what we got:

IMAP SESSION (SAVE E-MAIL TO 'SENT' MAILBOX) - Note the right mime-type
and boundary here

* OK [CAPABILITY IMAP4rev1 AUTH=LOGIN AUTH=CRAM-MD5 ID LITERAL+] dbmail
3.2.3 ready.
A0001 LOGIN ***@xxxxxx xxxxxxx
A0001 OK [CAPABILITY IMAP4rev1 ACL RIGHTS=texk NAMESPACE CHILDREN SORT
QUOTA THREAD=ORDEREDSUBJECT UNSELECT IDLE ID UIDPLUS WITHIN CONDSTORE
LITERAL+ ENABLE QRESYNC] User ***@mail.qa.schema31.it authenticated
A0002 LSUB "" Sent
* LSUB (\hasnochildren) "/" "Sent"
A0002 OK LSUB completed
A0003 LIST "" Sent
* LIST (\hasnochildren) "/" "Sent"
A0003 OK LIST completed
A0004 APPEND Sent (\Seen) {936+}
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="=_17681037babd7dadb94a79c2cf51cb1f"
Content-Transfer-Encoding: quoted-printable
Date: Thu, 14 Jul 2016 14:23:01 +0200
From: Utente di TEST <***@mail.qa.schema31.it>
To: ***@gmail.com
Subject: prova 2
Organization: SC31
Message-ID: <***@mail.qa.schema31.it>
X-Sender: ***@mail.qa.schema31.it
User-Agent: Roundcube Webmail/1.2.0

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

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

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html;
charset=
=3DUTF-8" /></head><body style=3D'font-size: 10pt; font-family:
Verdana,Gen=
eva,sans-serif'>

</body></html>

--=_17681037babd7dadb94a79c2cf51cb1f--

A0004 OK [APPENDUID 2028 2695213] APPEND completed
A0005 LOGOUT
* BYE
A0005 OK LOGOUT completed

SMTP SESSION (E-MAIL DISPATCH) - Note that content-type here is
'text/html' (maybe taken from the first non-empty mime-part?)

220 litio.roma.schema31.it ESMTP Sendmail 8.14.5/8.14.5; Thu, 14 Jul
2016 14:23:01 +0200 (CEST)
EHLO localhost
250-litio.roma.schema31.it Hello [10.33.100.158], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-STARTTLS
250-DELIVERBY
250 HELP
MAIL FROM:<***@mail.qa.schema31.it>
250 2.1.0 <***@mail.qa.schema31.it>... Sender ok
RCPT TO:<***@gmail.com>
250 2.1.5 <***@gmail.com>... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Date: Thu, 14 Jul 2016 14:23:01 +0200
From: Utente di TEST <***@mail.qa.schema31.it>
To: ***@gmail.com
Subject: prova 2
Organization: SC31
Message-ID: <***@mail.qa.schema31.it>
X-Sender: ***@mail.qa.schema31.it
User-Agent: Roundcube Webmail/1.2.0

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

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

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html;
charset=
=3DUTF-8" /></head><body style=3D'font-size: 10pt; font-family:
Verdana,Gen=
eva,sans-serif'>

</body></html>

--=_6e4cf8211c48e997305a4faab4020297--
.
250 2.0.0 u6ECN1Je026469 Message accepted for delivery
QUIT
221 2.0.0 litio.roma.schema31.it closing connection

Links:
------
[1] http://www.roundcubeforum.net/index.php/topic,23529.0.html
A.L.E.C
2016-07-14 14:02:49 UTC
Permalink
Post by s***@schema31.it
Hello all,
I've recently posted a bug reporting to the Roundcube community forum
<http://www.roundcubeforum.net/index.php/topic,23529.0.html>
We have noticed a strange behavior with a fresh Roundcube 1.2 install
(no additional plugins enabled nor 'strange' custom config defined).
To reproduce this, send an e-mail using the html editor, leaving a blank
content.
What PHP version? What Mail_Mime version? What OS? Are you using SMTP
server (smtp_server option) in Roundcube config?

Sounds like https://github.com/roundcube/roundcubemail/issues/5283, but
in your case SMTP debug already confirms that we really send malformed
message, so not exactly the same.
--
Aleksander 'A.L.E.C' Machniak
Kolab Groupware Developer [http://kolab.org]
Roundcube Webmail Developer [http://roundcube.net]
---------------------------------------------------
PGP: 19359DC1 @@ GG: 2275252 @@ WWW: http://alec.pl
s***@schema31.it
2016-07-14 14:13:30 UTC
Permalink
Thanks for the reply, we have tested this issue on multiple workstation,
mainly we have:

- PHP 5.5.X and 5.6.X

- OS Mac OS X and FreeBSD 10.3

- Mail_Mime version 1.10.0

and yes, SMTP server is defined within Roundcube config file.
Post by A.L.E.C
Post by s***@schema31.it
Hello all,
I've recently posted a bug reporting to the Roundcube community forum
<http://www.roundcubeforum.net/index.php/topic,23529.0.html>
We have noticed a strange behavior with a fresh Roundcube 1.2 install
(no additional plugins enabled nor 'strange' custom config defined).
To reproduce this, send an e-mail using the html editor, leaving a blank
content.
What PHP version? What Mail_Mime version? What OS? Are you using SMTP
server (smtp_server option) in Roundcube config?
Sounds like https://github.com/roundcube/roundcubemail/issues/5283, but
in your case SMTP debug already confirms that we really send malformed
message, so not exactly the same.
A.L.E.C
2016-07-14 17:58:49 UTC
Permalink
Post by s***@schema31.it
- PHP 5.5.X and 5.6.X
- OS Mac OS X and FreeBSD 10.3
- Mail_Mime version 1.10.0
Anyway... I couldn't reproduce the issue, but I think fixes for
https://github.com/roundcube/roundcubemail/issues/5283 should solve your
issue.

Additionally I pushed a change for Mail_mime that you also could try
https://github.com/pear/Mail_Mime/commit/fd983f94dfe5602afe43bc7d5a71fccff26262b9
--
Aleksander 'A.L.E.C' Machniak
Kolab Groupware Developer [http://kolab.org]
Roundcube Webmail Developer [http://roundcube.net]
---------------------------------------------------
PGP: 19359DC1 @@ GG: 2275252 @@ WWW: http://alec.pl
Brendan
2016-07-14 18:11:25 UTC
Permalink
Post by A.L.E.C
Post by s***@schema31.it
- PHP 5.5.X and 5.6.X
- OS Mac OS X and FreeBSD 10.3
- Mail_Mime version 1.10.0
Anyway... I couldn't reproduce the issue, but I think fixes for
https://github.com/roundcube/roundcubemail/issues/5283 should solve your
issue.
i believe this is the bug that is being hit - it's exactly the same
problem description that led me to raise it with thomas back in may.
Loading...