Subject decoding: OK in mail preview, wrong (raw) in message list (Broken RFC2047 encoded words in Subject: header. Space is wrongly placed in quoted-printable string)

RESOLVED DUPLICATE of bug 506927

Status

Thunderbird
Mail Window Front End
--
minor
RESOLVED DUPLICATE of bug 506927
8 years ago
6 years ago

People

(Reporter: denis.barmenkov, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Build Identifier: 3.0.4 RUS

In message list subject represented as raw:
=?ISO-8859-5?Q?=C3=D2=D5=D4=DE=DC=DB=D5=DD=D8=D5 =DE =D7=D0=D4=DE=DB=D6=D5=DD=DD=DE=E1=E2=D8?=

but in preview pane shows as good decoded text.

I mean that source code wait for refactoring so subject decoding processed in one place, not two or more.

Also look at attached screen shot.

Reproducible: Sometimes

Steps to Reproduce:
1.
(Reporter)

Comment 1

8 years ago
Created attachment 438687 [details]
Subj in two forms
This looks like it's sufficiently similar in root cause to bug 271312 that it could probably be marked as a duplicate. Objections?
Severity: normal → minor
Whiteboard: [dupeme]
(Reporter)

Comment 3

8 years ago
(In reply to comment #2)
> This looks like it's sufficiently similar in root cause to bug 271312 that it
> could probably be marked as a duplicate. Objections?

Its not duplicate I mean: 
right way to process encoded subject:
- decode to text in correct charset
- wrap on UI

Here (you can look at screen shot) subject keep encoded in message list.
(Reporter)

Comment 4

8 years ago
Created attachment 438692 [details]
original subject from message source (Ctrl-U)
(Reporter)

Comment 5

8 years ago
there was no tab/newline characters in message source so its probably not bug 271312.
Key point here is "root cause" -- the bug symptoms are of course different, but the essential part is that your proposed fix of unifying the parse code for header pane and message list pane would fix both bugs -- they are driven by the same flaw underneath.
(In reply to comment #4)
> original subject from message source (Ctrl-U)
> Subject: =?ISO-8859-5?Q?=C3=D2=D5=D4=DE=DC=DB=D5=DD=D8=D5 =DE =D7=D0=D4=DE=DB=D6=D5=DD=DD=DE=E1=E2=D8?=

AFAK, a space(x020) in string after encoding in quoted-printable is invalid. It should be encoded as =20 in encoded string in quoted-printable.

Local mail folder(POP3 or "Local Folders")? Or IMAP folder?
If IMAP folder, do next.
(1) Copy the mail to a local mail folder(say "Test").
(2) "Rebuild Index" at folder property of "Test".
What is displayed at thread pane and message header box for the mail in local "Test" folder?
(Reporter)

Comment 8

8 years ago
(In reply to comment #7)
> (In reply to comment #4)
> > original subject from message source (Ctrl-U)
> > Subject: =?ISO-8859-5?Q?=C3=D2=D5=D4=DE=DC=DB=D5=DD=D8=D5 =DE =D7=D0=D4=DE=DB=D6=D5=DD=DD=DE=E1=E2=D8?=
> 
> AFAK, a space(x020) in string after encoding in quoted-printable is invalid. It
> should be encoded as =20 in encoded string in quoted-printable.
> 
> Local mail folder(POP3 or "Local Folders")? Or IMAP folder?
> If IMAP folder, do next.
> (1) Copy the mail to a local mail folder(say "Test").
> (2) "Rebuild Index" at folder property of "Test".
> What is displayed at thread pane and message header box for the mail in local
> "Test" folder?

Really, after copying to local folder and rebuilding index subject displays fine in both panes.

About space in quoted-printable strings: there shall be one place for decoding string so this buggy (?) subject can decoded at both panes or not decoded at all.
(In reply to comment #8)
> > Local mail folder(POP3 or "Local Folders")? Or IMAP folder?
> > If IMAP folder, do next.
> > (1) Copy the mail to a local mail folder(say "Test").
> > (2) "Rebuild Index" at folder property of "Test".
> > What is displayed at thread pane and message header box for the mail in local
> > "Test" folder?
> 
> Really, after copying to local folder and rebuilding index subject displays
> fine in both panes.

Does it mean that this bug is for problem with IMAP?
If so, it's possibly next.
- space(0x20) in quoted-printable is invalid.
- Tb has quirks for such malformed header.
  (accepts space=0x20 in quoted-printable of mail header)
- The quirks works if local mail folder.
  (upon download from POP3, or upon rebuild-index of local mail folder)
- The quirks doesn't work for header returned by fetch BODY.PEEK[HEADERS ...
  SUBJECT ... upon mail header download from IMAP server.
- The quirks works for header display at messega header box.

Can you get IMAP log for next?
> https://wiki.mozilla.org/MailNews:Logging
> http://www.mozilla.org/projects/nspr/reference/html/prlog.html#25328
> SET NSPR_LOG_MODULES=timestamp.IMAP:5
(1) Terminate Tb, Restart Tb with NSPR logging enabled.
(2) Create folder X1 and X2.
    X1 : offline use=on  (Folder Properties/Synchronization)
    X2 : offline use=off (Folder Properties/Synchronization)
(3) Copy the mail to X1 and X2.
(4) At X1 and X2, rebuild-index at Folder Properties/General.
(5) View the mail in X1 and X2.
(6) Terminate Tb, save NSPR log file.
    Note: Please never paste long log data. If log analysys by developers is
          required, attach log file, please.

What is displayed at folder pane of X1 and X2?
What is displayed at message header box?
Is something funny seen in NSPR log? (arround FETCH of mail header data)
FYI.
Bug 587510 is report of similar phenomenon with similarily broken header.

Updated

7 years ago
Duplicate of this bug: 587510

Updated

7 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [dupeme]
Summary: Subject decoding: OK in mail preview, wrong (raw) in message list → Subject decoding: OK in mail preview, wrong (raw) in message list (Broken RFC2047 encoded words in Subject: header. Space is wrongly placed in quoted-printable string)

Comment 12

6 years ago
(In reply to comment #9)
> (In reply to comment #8)
> > > Local mail folder(POP3 or "Local Folders")? Or IMAP folder?
> > > If IMAP folder, do next.
> > > (1) Copy the mail to a local mail folder(say "Test").
> > > (2) "Rebuild Index" at folder property of "Test".
> > > What is displayed at thread pane and message header box for the mail in local
> > > "Test" folder?
> > 
> > Really, after copying to local folder and rebuilding index subject displays
> > fine in both panes.
> 
> Does it mean that this bug is for problem with IMAP?
> If so, it's possibly next.
> - space(0x20) in quoted-printable is invalid.
> - Tb has quirks for such malformed header.
>   (accepts space=0x20 in quoted-printable of mail header)
> - The quirks works if local mail folder.
>   (upon download from POP3, or upon rebuild-index of local mail folder)
> - The quirks doesn't work for header returned by fetch BODY.PEEK[HEADERS ...
>   SUBJECT ... upon mail header download from IMAP server.
> - The quirks works for header display at messega header box.
> 
> Can you get IMAP log for next?
> > https://wiki.mozilla.org/MailNews:Logging
> > http://www.mozilla.org/projects/nspr/reference/html/prlog.html#25328
> > SET NSPR_LOG_MODULES=timestamp.IMAP:5
> (1) Terminate Tb, Restart Tb with NSPR logging enabled.
> (2) Create folder X1 and X2.
>     X1 : offline use=on  (Folder Properties/Synchronization)
>     X2 : offline use=off (Folder Properties/Synchronization)
> (3) Copy the mail to X1 and X2.
> (4) At X1 and X2, rebuild-index at Folder Properties/General.
> (5) View the mail in X1 and X2.
> (6) Terminate Tb, save NSPR log file.
>     Note: Please never paste long log data. If log analysys by developers is
>           required, attach log file, please.
> 
> What is displayed at folder pane of X1 and X2?
> What is displayed at message header box?
> Is something funny seen in NSPR log? (arround FETCH of mail header data)

On the next Tuesday of a full moon, while walking down Main Street, turn left at Oak Street and clap your hands three times. just kidding. but, then, who's paying attention, anyway?

Comment 13

6 years ago
Sorry, I should be helpful, not a mouthful. And I see the steps aren't that bad anyway. :-)
I only got here after Bug 521238 was closed INVALID for similar headers, but UTF-8 and base64. My example (Bug 672424) is us-ascii q-p.

Subject: =?us-ascii?Q?TECHP -- Aajax Paper Testing - Aberdeen, UT
 CASE#(CAS-01932-Z259) -- Lunch?=

As you see, it violates the RFC as well, but displays raw in both panes.
Blocks: 673092
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 506927
You need to log in before you can comment on or make changes to this bug.