Uncategorized

Re: Security Update 2006-001, SquirrelMail 1.4.5 and PHP 4.4.1 [by celiawessen]


/usr/libexec/httpd/libphp4.so
/usr/libexec/httpd/libphp4.3.11.so

*** Update 3/15/2006***

OK, so here comes Apple’s Security Update 2006-002. It contains the PHP 4.4.1 and SM 1.4.5 update again.

I installed the security patch, then reinstalled the Japanese patch for SM 1.4.5, and uploaded the precompiled ja_JP locale files available from SquirrelMail.JP. It all looked good until I noticed that if I sent a message with a Japanese subject and no Japanese characters in the body, the message gets encoded in 8bit. This creates a problem for strict e-mail client software like Mail.app.

I didn’t notice this at first because the subject line looked fine in SM. But after retrieving the same messages from the IMAP server using Mail.app, I found that the subject line had mojibake.

This problem does not occur if there are Japanese characters in the subject line and the body of the message. In that case, the message gets encoded into 7bit.

It is rare that anybody would send a message with a Japanese subject line and no Japanese characters in the body… but it does happen.

So, I downgraded PHP to 4.3.11 from my trusty backup.



cd
/usr/libexec/httpd

cp libphp4.so libphp4.4.1.so

cp libphp4.3.11.so libphp4.so

apachectl restart

Now the same 7/8bit problem still occurs. But for some reason, the subject lines started looking fine in Mail.app… what the fcuk is happening? I think it has something to do with the mbstr.mimeheaderencoding in PHP 4.4.1 that can only be patched pre-compilation.

Because Mac OS X Server does not ship with many of the libraries necessary to recompile PHP, I just gave up. It is a hassle to collect them all unless you’re going to compile other stuff too.