Subject quote problem

Hi List,

I think there is a problem with mime-encoded header handling.
The following code (and comments) are in file (3.8.7):

It’s legal for headers to contain mime-encoded commas and semicolons which

should not be treated as address separators. (Encoding == quoting here)

until this is fixed, we must escape any string containing a comma or


this is only a bandaid

Some other MUAs encode quotes already, and double quotes

confuse us a lot, so only quote it if it isn’t quoted


$enc_str = qq{"$enc_str"} if $enc_str =~ /[,;]/ and $enc_str !~ /^".*"$/;
It is good for To, Cc and other fields because non-ascii, encoded names
before email
addresses can containt commas and semicolons, for example:
NonAscii, Name
"NonAscii, Name"
and that’s why commas don’t cause problems, but it’s not good for subject.
If I have a non-ascii subject with comma or semicolon it will be quoted.
Non-ascii, subject
"Non-ascii, subject"
It’s not good but tolerable. But if I have a long non-ascii subject, I will
a worse thing:
It is a very long non ascii subject with commas, in the header, it will be
encoded and multiline
becomes something like this:
“It is a very long non ascii subject with commas, in”" the header, it will
be encoded and multiline"
It’s not good if you parse the subject, and may annoy your users.

I attached a patch that I use to avoid this problem. It’s maybe useful but
maybe you have a better solution
or opinion about this problem. Please let me know if there is!

Docca OutSource IT Ltd

subject_noquote.diff (834 Bytes)