User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040616
Build Identifier: version 0.9 (20041103)
Searching messages bodies for plain text messages encoded using quoted-printable
will not generate proper results, many messages will be missed.
The cause seems to be the fact that a literal search is performed on the message
body without first decoding the content. In quoted-printable lines are wrapped
and the = sign is used to mark a continuation. If the string you are searching
for happens to be split across two lines then it will not be found.
Steps to Reproduce:
1. Identify some text message encoded using quoted-printable
2. Look for some string that is wrapped using = as a contonuation marker
3. Search for that string
The message is not found
It should be found
Here is an example:
Subject: Production Errors
Content-Type: text/plain; charset=Cp1252
2004-11-08 12:34:04,773 DEBUG [LanguageCache.getLanguage(Line 140)] Could n=
ot find language for locale: en_US. Using language code en to find the lang=
Searching for "Could not find language" or "find the language." will not produce
Reproduced with TB version 0.9+ (20041112), and also Moz 1.8a5.
Message filters suffer same problem for me (mozilla 1.5 on Solaris2.8), such as
(Body contains "=>") fails due to the wrapping issue but also because in
quoted-printable an embedded "=" is "=3D".
Sorry for some slightly off-topic digression here: Was hoping to find in
bugzilla an answer to: Are there UNIX mail filters that can simply cleanse all
incoming email, convert quoted-printable to 8-bit absolutely everywhere, even
handling attachments)? I've heard of a few (sendmail) but that only do simple
single-part email bodies, not multi-part or attachments, thus no use to me.
Tempting to request mozilla-mail config option by which it will undo
quoted-printable in all incoming emails. I realize this won't fly due to the
desire to preserve the incoming emails as-is as much as possible. Likewise any
notion of building such conversion into movemail (which I use, built-in) would
not fly. But still permits option of a third-party "external" movemail to do so.
However I anyway use also use procmail-based filters, also broken by
quoted-printable same way as mozilla, thus I'd need a undo-quoted-printable
filter that stands alone from mozilla.
*** Bug 293191 has been marked as a duplicate of this bug. ***
tbird has the same problem.
cc'ing david / mscott.
Similar to this bug, I found that if the Content-Transfer-Encoding is base64 then I also cannot search for plain text in the body of the message. Same problem for the message filters. It seems likely that spammers are using this to get around junk mail filtering. (It prevents me from filtering out email that has certain undesireable websites in it.)
I am using Tbird 1.5
Am filing here so that a generic solution to different Content-Transfer-Encoding's can be implemented rather than just for quoted-printable.
FYI, an additional complication on the email I am looking at is that charset="iso-2022-jp" but I tried searching and filtering on plain ascii text, so I doubt that this is the reason it didnt work.
Just speculating here, but I wonder if spam filtering is able to see into these encoded body parts. Various reports of problems in spam identification, like bug #280716 and bug #284308 both have examples that contain quoted-printable body parts....
Bug 132340 is this same problem, but for base64 instead of q-p.
Linux too, latest branch build.
Created attachment 255226 [details] [diff] [review]
replace soft line break with space
I believe search at least already goes through the quoted printable decoding; but we weren't dealing with soft line breaks correctly
You're converting an '=' at the end of the line to a space? Is that correct? I thought that was an explicit indicator to concatenate without whitespace; if a space is desired, the line ends with '=20' or else has a space immediately before the '='.
Mike, you could be right - I'll need to find a test message...
Created attachment 255241 [details] [diff] [review]
eat soft line breaks, don't insert a space
thx, Mike - you were right as usual. This patch just eats the soft line break, leaving the space. I've tested this doing a quick search on mesasge body's in a folder looking for a string that spans a quoted printable soft line break and it seems to work fine.
fixed on trunk and branch
TB 2b2-0217, this doesn't seem to be working for me. David, I sent you a test message which included these source lines:
Uw advertentie staat dan weer bovenaan in de rubriek! Bellers met een Pre=
Pay telefoon of een pulse telefoon kunnen geen gebruik maken van deze die=
nst. Belgische adverteerders bellen naar: 0903 - 42040.
Searching the folder for Body, contains, "prepay" (or "dienst") fails to find the message.
Mike, I know you sent me that message, but I can't find it. Can you resend it? Thx!
Mike, never mind, it was in my junk folder.
Ugh, in the find case, we do decode the QP one line at a time, whereas in the preview text case (the other caller of this code, which now works), we pass in a block of text, including the line endings.
So to fix this, I need to change nsMsgSearchTerm::MatchBody to coalesce quoted printable lines that end with '='.
Which again points to the MIME architecture. The q-p text should not be what's getting parsed -- C-T-E should be decoded before search ever gets it.
rewriting body search to go through the mime converter would certainly fix some issues - easy, it isn't.
Created attachment 255828 [details] [diff] [review]
fix search case.
concatenate lines with QP soft-linebreak before doing search.
last patch landed on trunk and branch.
V with 2b2-0221, Win2K. Works in QuickSearch | Entire Message, too.