1

I have switched the encoding of sent emails, with the patch related in this post:

Email from PHP has broken Subject header encoding

It works great from one of our server, (in Outlook and gmail)

To: coil@domain.com
Subject: =?UTF-8?B?U3VqZXQgYXZlYyBkw6lzIGFjY8Oow6jDqMOow6jDqMOobnRzIOKCrCAhIQ==?=
Date: Wed, 31 Aug 2011 16:37:38 +0200

The subject and body are OK.

But on the second server, there is a weird behaviour, I get this email header for the subject:

To: coil@domain.com
Subject: =?US-ASCII?B?PT9VVEYtOD9CP1UzVnFaWFFnWVhabFl5?=
 =?US-ASCII?B?Qmt3Nmx6SUdGalk4T293NmpEcU1Pb3c2akRxTU9vYm5SeklPS0NyQ0FoSVE9?=
 =?US-ASCII?B?PT89?=

It seems that the subject is re-encoded and forced to US-ASCII, it leads to an unreadable subject and the UTF8 characters are lost in the body.

The same test script and email class is used on both servers.

Any idea where this bug could comes from ?

Community
  • 1
  • 1
COil
  • 7,201
  • 2
  • 50
  • 98
  • What do the `Received:` headers look like in these two different cases? – tripleee Sep 01 '11 at 09:48
  • The received section of the 2 cases only differs in the postfix mail server number. (6 -> 16) and there is an extra header in the mail that is ok: "X-Nnbl-Tag" – COil Sep 01 '11 at 10:35
  • So you have Postfix as the MTA on both computers? Are they configured exactly the same? (What do you mean by "postfix mail server number"?) – tripleee Sep 01 '11 at 10:44
  • 1st server is srv16.domain.fr (Postfix) and second is srv6.domain.fr (Postfix). I will investigate about the configuration, thanks. – COil Sep 01 '11 at 11:42

1 Answers1

0

The bug was due to the mbstring.func_overload value. It was changed from 7 to 6 and now it works as expected. Thanks for your help.

COil
  • 7,201
  • 2
  • 50
  • 98