Found by Masato Higashiyama
Reported by Scott A. Hughes
There is a problem with subject folding that affects
Japanese in 1.4.0rc1. This problem is likely to affect
some other languages also.
The following is an illustration of the problem.
With a subject of:
Subject:
test=?ISO-2022-JP?B?GyRCJEYkOSRIGyhC?=test=?ISO-2022-JP?B?GyRCJUYlOSVIGyhC?=
The subject is sent as below:
Subject: test=?ISO-2022-JP?B?GyRCJEYkOSRIGyhC?=test=
?ISO-2022-JP?B?GyRCJUYlOSVIGyhC?=
The encoded character string is folded mid-way, hence
preventing successful decoding.
In order for correct decoding, the subject must be as
follows.
Subject: test=?ISO-2022-JP?B?GyRCJEYkOSRIGyhC?=test
=?ISO-2022-JP?B?GyRCJUYlOSVIGyhC?=
-- End --
Logged In: YES
user_id=476981
When does this problem occur?
Is it with sending messages or when you read a message?
Logged In: YES
user_id=79178
The problem occurs when sending messages.
Logged In: YES
user_id=476981
Folding is happening correct, when a mailclient wants to
decode the subject it has de unfold the header before it starts
decoding and that's probably the problem. I can manipulate
the folding routine in the deliver class but I have to be sure
that other mailclients can't decode the subject due to the
folding method we use or that SquirrelMail is the only client
that decodes the subject incorrect (which means not unfold
first).
Can you confirm that other mailclients then SquirrelMail
cannot decode the subject due to the way we fold it?
Logged In: YES
user_id=476981
Excuse me, folding is happening incorrect, according
RFC2047:
2. Syntax of encoded-words
An 'encoded-word' is defined by the following ABNF
grammar. The notation of RFC 822 is used, with the
exception that white space characters MUST NOT appear
between components of an 'encoded-word'.
encoded-word = "=?" charset "?" encoding "?" encoded-
text "?="
Probably I have to add a regular expression that looks for
=? ... ?= sequences and prohibit that we fold inside such
sequence.
Logged In: YES
user_id=79178
Masato recently sent a group of patches to Philippe, and
this issue is dealt with there. Thank you for following this
up and hopefully the patches sent will help identify this issue.