Ticket #1485571 (closed Bugs: fixed)

Opened 7 weeks ago

Last modified 7 weeks ago

not MIME encoding outgoing emails correctly

Reported by: ldeviator Owned by:
Priority: 5 Milestone: 0.2-stable
Component: PHP backend Version: svn-trunk
Severity: normal Keywords:
Cc: ld@…

Description

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@…> Subject: test MIME-Version: 1.0 Date: Tue, 18 Nov 2008 15:51:43 -0600 From: Nick Mossie <nick@…> Organization: Temp-Stop, LLC Message-ID: <9f4e49886db6fd74cae64f3c11c74b6d@…> X-Sender: nick@… 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 ZCBpbiB0aGlzIG1lc3NhZ2UgaXMgY29uZmlkZW50aWFsCmFuZCBtYXkgY29uc3RpdHV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VyIG9mID0KdGhlIGRlbGl2ZXJ5IGVycm9yIGJ5 IHJldHVybiBlLW1haWwgb3IgeW91IG1heSBjYWxsIG91ciBvZmZpY2UgYXQgKDgxNikgNTU0PQot MzM1Mi48YnIgLz48YnIgLz5UaGFuayB5b3UuPC9wPgo8L2Rpdj4KLS09Xzc1ZjgwNTVhNTU2NDg5 YTgwNmQyMTgwOWRjYWRiZWJkLS0K --=_75f8055a556489a806d21809dcadbebd--

which when decoded looks like this:

To: Nick Mossie <ld@…> Subject: test MIME-Version: 1.0 Date: Tue, 18 Nov 2008 15:51:43 -0600 From: Nick Mossie <nick@…> Organization: Temp-Stop, LLC Message-ID: <9f4e49886db6fd74cae64f3c11c74b6d@…> X-Sender: nick@… 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@… [1]

This 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] mailto:nick@…

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

<p style=3D"text-align: left;">test</p> <div> <p>Nick Mossie<br />Information Technology<br /><span style=3D"color: #ff00= 00;"><strong>Temp-Stop, LLC<br /></strong></span>331 NW Capital Drive<br />= Lee's Summit, MO 64086<br />(816) 554 - 3352<br />Fax : (816) 554-6556<br /=

Email : <a href=3D"mailto:nick@…">nick@…</a><br /><b=

r /><img src=3D"http://www.tempstop.net/signature_logo.gif" alt=3D"" /><br = />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.<br /><br=

/>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.<br /><br />Thank you.</p> </div> --=_75f8055a556489a806d21809dcadbebd-- \377\276_\363Nyk\236z\343\317Z\363N\235\333_4\365\327Zu\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@…> To: ld@… Subject: beta test Organization: Temp-Stop, LLC Message-ID: <11dc47ed1f504164d176ae2ff97d66ef@…> X-Sender: nick@… 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@… [1]

This 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] mailto:nick@…

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

<p>test</p> <div> <p>Nick Mossie<br />Information Technology<br /><span style=3D"color: #ff00= 00;"><strong>Temp-Stop, LLC<br /></strong></span>331 NW Capital Drive<br />= Lee's Summit, MO 64086<br />(816) 554 - 3352<br />Fax : (816) 554-6556<br /=

Email : <a href=3D"mailto:nick@…">nick@…</a><br /><b=

r /><img src=3D"http://www.tempstop.net/signature_logo.gif" alt=3D"" /><br = />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.<br /><br=

/>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.<br /><br />Thank you.</p> </div> --=_f66da144518fb74b6c9302dde0d8da31--

Attachments

base64message.txt (3.4 kB) - added by ldeviator 7 weeks ago.
an example base64 message
base64message_decoded.txt (2.7 kB) - added by ldeviator 7 weeks ago.
an example base64 message decoded
non-base64message.txt (2.5 kB) - added by ldeviator 7 weeks ago.
an exampled of the same message from rc 0.2 beta that works
main.inc.php.txt (17.5 kB) - added by ldeviator 7 weeks ago.
main.inc.php file in use
phpinfo.html (51.5 kB) - added by ldeviator 7 weeks ago.
my phpinfo()
phpuseflags.txt (7.7 kB) - added by ldeviator 7 weeks ago.
php use flags .. trac hates my pasting :)

Change History

Changed 7 weeks ago by ldeviator

an example base64 message

Changed 7 weeks ago by ldeviator

an example base64 message decoded

Changed 7 weeks ago by ldeviator

an exampled of the same message from rc 0.2 beta that works

Changed 7 weeks ago by ldeviator

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

Changed 7 weeks ago by alec

  • component changed from Core functionality to MIME parsing

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

Changed 7 weeks ago by ldeviator

main.inc.php file in use

Changed 7 weeks ago by ldeviator

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

Changed 7 weeks ago by ldeviator

  • cc ld@… added

Changed 7 weeks ago by ldeviator

my phpinfo()

Changed 7 weeks ago by ldeviator

use flags for PHP

[ Found these USE variables for dev-lang/php-5.2.6-r7 ]

U I

  • - adabas : Adds support for the Adabas database engine + + apache2 : Add Apache2 support
  • - bcmath : Adds support for libbcmath + + berkdb : Adds support for sys-libs/db (Berkeley DB for MySQL)
  • - birdstep : Adds support for the Birdstep Database Server
  • - bzip2 : Use the bzlib compression library + + calendar : Adds support for calendars (not using mcal!)
  • - cdb : Adds support for the CDB database engine from the author of qmail
  • - cgi : Add CGI script support
  • - cjk : Adds support for Multi-byte character languages (Chinese, Japanese, Korean) + + cli : Enable CLI SAPI
  • - concurrentmodphp : Make it possible to load both mod_php4 and mod_php5 into the same Apache2 instance (experimental) + + crypt : Add support for encryption -- using mcrypt or gpg where applicable
  • - ctype : Enables ctype functions
  • - curl : Adds support for client-side URL transfer library
  • - curlwrappers : Adds support for using curl in streams
  • - db2 : Enables support for IBM DB2 database server
  • - dbase : Adds support for dbase file format
  • - dbmaker : Adds support for dbmaker database server
  • - debug : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see http://www.gentoo.org/proj/en/qa/backtraces.xml
  • - discard-path : Switch on common security setting for CGI SAPI
  • - doc : Adds extra documentation (API, Javadoc, etc)
  • - empress : Adds support for the Empress database server
  • - empress-bcs : Adds local access support for the Empress database server
  • - esoob : Adds support for Easysoft OOD database
  • - exif : Adds support for reading EXIF headers from JPEG and TIFF images
  • - fastbuild : Build PHP quicker (experimental)
  • - fdftk : Add supports for Adobe's FDF toolkit.
  • - filter : Add filter extension support
  • - firebird : Adds support for the Firebird relational database
  • - flatfile : Adds dbm support for flat files
  • - force-cgi-redirect : Switch on common security setting for CGI SAPI
  • - frontbase : Adds support for the frontbase sql server
  • - ftp : Adds FTP (File Transfer Protocol) support + + gd : Adds support for media-libs/gd (to generate graphics on the fly)
  • - gd-external : Use the external version of gd rather than the bundled one (possibly dangerous) + + gdbm : Adds support for sys-libs/gdbm (GNU database libraries)
  • - gmp : Adds support for dev-libs/gmp (GNU MP library)
  • - hash : Enable the hash extension + + iconv : Enable support for the iconv character set conversion library + + imap : Adds support for IMAP (Internet Mail Application Protocol)
  • - inifile : Adds dbm support for .ini files
  • - interbase : Adds support for Interbase database
  • - iodbc : Adds support for iODBC library + + ipv6 : Adds support for IP version 6
  • - java-external : Use the external java extension rather than the bundled one + + json : Enable JSON support
  • - kerberos : Adds kerberos support
  • - kolab : Adds support for the Kolab groupware server + + ldap : Adds LDAP support (Lightweight Directory Access Protocol)
  • - ldap-sasl : Add SASL support for the PHP LDAP extension
  • - libedit : Use the libedit library (replacement for readline)
  • - mcve : Support for the MCVE credit card payment system
  • - mhash : Adds support for the mhash library
  • - msql : Adds support for the MSQL database server
  • - mssql : Adds support for Microsoft SQL Server database + + mysql : Adds mySQL Database support + + mysqli : Adds support for the improved mySQL libraries + + ncurses : Adds ncurses support (console display library) + + nls : Adds Native Language Support (using gettext - GNU locale utilities)
  • - oci8 : Adds Oracle 8 Database Support
  • - oci8-instant-client : Use dev-db/oracle-instantclient-basic as Oracle provider instead of requiring a full Oracle server install
  • - odbc : Adds ODBC Support (Open DataBase? Connectivity)
  • - pcntl : Adds support for process creation functions + + pcre : Adds support for Perl Compatible Regular Expressions
  • - pdo : Enable the bundled PDO extensions
  • - pic : Build Position Independent Code. Do not utilize this flag unless you know what you're doing
  • - posix : Adds support for POSIX-compatible functions
  • - postgres : Adds support for the postgresql database
  • - qdbm : Adds support for the qdbm (Quick Database Manager) library + + readline : Enables support for libreadline, a GNU line-editing library that almost everyone wants
  • - recode : Enables support for the GNU recode library + + reflection : Enable the reflection extension (Reflection API)
  • - sapdb : Adds support for SAP DB + + session : Adds persistent session support
  • - sharedext : Adds support for building shared extensions in PHP
  • - sharedmem : Adds support for shared memory use + + simplexml : support for SimpleXML
  • - snmp : Adds support for the Simple Network Management Protocol if available
  • - soap : Adds support for SOAP (Simple Object Access Protocol)
  • - sockets : Adds support for tcp/ip sockets
  • - solid : Adds support for the Solid database engine + + spell : Adds dictionary support + + spl : Adds support for the Standard PHP Library
  • - sqlite : Adds support for sqlite - embedded sql database + + ssl : Adds support for Secure Socket Layer connections
  • - suhosin : Add Suhosin support (patch and extension from http://www.suhosin.org/)
  • - sybase : Adds support for the Sybase SQL Database Server
  • - sybase-ct : Adds support for Sybase-CT
  • - sysvipc : Support for System V-compatible inter-process communication
  • - threads : Adds threads support for various packages. Usually pthreads
  • - tidy : Adds support for HTML Tidy
  • - tokenizer : Adds support for the PHP file parser + + truetype : Adds support for FreeType? and/or FreeType?2 fonts + + unicode : Adds support for Unicode
  • - wddx : Adds support for Web Distributed Data eXchange + + xml : Add support for XML files
  • - xmlreader : Enable XMLReader support
  • - xmlrpc : Support for xml-rpc library
  • - xmlwriter : Enable XMLWriter support
  • - xpm : Adds support for XPM graphics format
  • - xsl : Check/Support flag for XSL library (version 1)
  • - yaz : Adds in optional support for the Z39.50 Protocol for Information Retrieval (YAZ)
  • - zip : Enable ZIP file support
  • - zip-external : Enable ZIP file support (external PECL extension) + + zlib : Adds support for zlib (de)compression

Changed 7 weeks ago by ldeviator

php use flags .. trac hates my pasting :)

Changed 7 weeks ago by ldeviator

I tracked this down... this happens if you use the php mail() function in my setup, which happens if you leave the $rcmail_configsmtp_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

Changed 7 weeks ago by ldeviator

extra headers actually:

Mime-Version: 1.0
Content-Transfer-Encoding: BASE64

Changed 7 weeks ago by ldeviator

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

Changed 7 weeks ago by alec

  • status changed from new to closed
  • resolution set to fixed
  • component changed from MIME parsing to PHP backend

Added .htaccess entry in r2073.

Note: See TracTickets for help on using tickets.