From: Paul L. <pa...@sq...> - 2009-09-16 02:36:28
|
All, Sorry for the cross-post (to the devel list), but I wanted to catch the attention of anyone using different charsets with SquirrelMail and see if they had any feedback on this issue. At the least, maybe people here would be willing to test the attached patch and see if it causes any issues. Thanks. I was looking into a problem where encoded FROM headers weren't being quoted, which causes problems when replying if they have a comma in them. US-ASCII (non-encoded) FROM headers are always encased in quotes for this very reason I believe (in case a comma is found within). It depends on the charset/encoding in question (any language can provide its own encoding via XTRA_CODE in the language setup (I didn't check those routines), and other multibyte character sets use the encodeHeaderBase64() function), but if the code in encodeHeader() is used, quotes around the full name part of the email address can cause problems because they are not always encoded. I didn't dissect the code in this function (which is why I'm asking), but found that adding a simple test for quotes "fixes" this issue. --- functions/mime.php (revision 13833) +++ functions/mime.php (working copy) @@ -789,6 +789,7 @@ for($i = 0; $i < $j; ++$i) { switch($string{$i}) { + case '"': case '=': case '<': case '>': What I'd like to know is what the consequences are of making this change - does this have possible large effects on anything else? Or is it just a matter of performance (the function seems to try to be as "ungreedy" as possible, only encoding things that don't have 8-bit characters in them)? Please see the full patch attached to this message that puts quotes around encoded full name-style FROM headers. See also the two bug reports about this problem: http://thread.gmane.org/gmane.mail.squirrelmail.user/36501 https://sourceforge.net/tracker/index.php?func=detail&aid=2830141&group_id=311&atid=100311 Thanks, Paul -- Paul Lesniewski SquirrelMail Team Please support Open Source Software by donating to SquirrelMail! http://squirrelmail.org/donate_paul_lesniewski.php |