Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#1483976 closed Bugs (invalid)

MIME-encoding breaks From: header

Reported by: fnord Owned by:
Priority: 10 - Lowest Milestone: 0.1-rc1
Component: Core functionality Version: 0.1-beta
Severity: critical Keywords:
Cc:

Description

I'm running SVN (checked out five minutes ago), and _encodeHeaders isn't doing the right thing for the From: header.

I've input a test name "Mattias åäöÅÄÖ Bergsten" since the recipients of messages from Roundcube were getting weird results (such as mails not getting through a lot of spam filters and looking very strange in Thunderbird and most webmails) when sent by someone with non-ASCII characters in their name.

MIME-encoded, it's supposed to look like this:

From: =?ISO-8859-1?Q?Mattias_=E5=E4=F6=C5=C4=D6_Bergsten?= <fnord@…>

Instead, it looks like this:

From: =?ISO-8859-1?Q?Mattias_=E5=E4=F6=C5=C4=D6_Bergsten_<fnord@…>?=

Most other clients MIME-encode by word, not by the entire string. It's certainly wrong to encode the email address part.

I fiddled with the code a bit, but I'm not good enough to fix it.

Please fix ASAP!

Change History (6)

comment:1 Changed 7 years ago by thomasb

  • Milestone set to 0.1-rc1
  • Resolution set to fixed
  • Status changed from new to closed

Wrong encoding since [a8435bdd]. Restored old code for header quoted_printable encoding.

comment:2 Changed 7 years ago by honza

  • Resolution fixed deleted
  • Status changed from closed to reopened

It's forever wrong in [7139e33e] :(.

=?UTF-8?Q?Jan=20Miku=C5=A1=20<mikus@itcomputers.cz>?=

comment:3 Changed 7 years ago by thomasb

Looks like the old code... If available, iconv_mime_encode is used for header encoding. Please make sure, this is not used and confirm the wrong behavior of the lines 825 to 833 in lib/Mail/mime.php

comment:4 Changed 7 years ago by honza

  • Resolution set to invalid
  • Status changed from reopened to closed

Yes, code is OK.

There is problem with php function iconv_mime_encode. If field (From, To, etc.) is encoded by function iconv_mime_encode, then returns bad encoded header.

comment:5 Changed 7 years ago by thomasb

Please test with the latest Trunk and reopen the bug if needed.

comment:6 Changed 7 years ago by honza

Yes, this is fine. Thanks.

Note: See TracTickets for help on using tickets.