Closed Bug 705587 Opened 13 years ago Closed 2 years ago

For malformed message with multiple headers of same type (but RFC 5322 max-number=1), TB should only use the first header instance consistently (show/use only the first From:, To:, Date: etc. in message list, message reader, replies, filtering etc.)

Categories

(MailNews Core :: MIME, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 310189

People

(Reporter: neal, Unassigned)

References

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0
Build ID: 20111104165243

Steps to reproduce:

I sent an email using the following PHP script and then checked my email in Thunderbird

<?php
mail('me@myemailaddress.com', 'Test Email', 'Test Message', "From: asdf@asdf.com\nFrom:foobar@google.com");


Actual results:

The UI displayed the From: header inconsistently. The list of messages displayed the sender as foobar@google.com, but viewing the actual message listed the sender as asdf@asdf.com.


Expected results:

The From value should have been consistent between the two views.
Depends on: 678322
I filed this separately from bug 310189 at the request of WADA.
Following is headers defined as "Max number=1" in RFC 5322.
> http://tools.ietf.org/html/rfc5322#section-3.6
>    +----------------+--------+------------+
>    | Field          | Min    | Max number |
>    |                | number |            |
>    +----------------+--------+------------+
>    | orig-date      | 1      | 1          |
>    | from           | 1      | 1          |
>    | sender         | 0*     | 1          |
>    | reply-to       | 0      | 1          |
>    | to             | 0      | 1          |
>    | cc             | 0      | 1          |
>    | bcc            | 0      | 1          |
>    | message-id     | 0*     | 1          |
>    | in-reply-to    | 0*     | 1          |
>    | references     | 0*     | 1          |
>    | subject        | 0      | 1          |
>    +----------------+--------+------------+

If Max number=1, "multiple headers" means malformed mail, and first header should be used for thread pane display & message pane display(this bug), and in message filtering & search too(bug 310189). This should be consistent among headers defined as "Max number=1".

bug 172104 fixed problem on multiple Subject: only. So this bug is followup bug of bug 172104.
Blocks: 172104, 310189
Component: Mail Window Front End → MIME
OS: Windows 7 → All
Product: Thunderbird → MailNews Core
QA Contact: front-end → mime
Hardware: x86_64 → All
Summary: Malformed mail with multiple From headers should use first header → Malformed mail with multiple From headers should use first header (problem on any header defined as max number=1, for example From:. first header should be used))
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Malformed mail with multiple From headers should use first header (problem on any header defined as max number=1, for example From:. first header should be used)) → Malformed mail with multiple From headers should use first header (problem on any header defined as max number=1, for example From:, To:. first header should be used)

Confirming for 88.0a1 (2021-03-17) (64-bit).
We have inconsistent handling of malformed messages with multiple headers of same type (To, From, Date etc.) in spite of max-number=1.
Particularly, what we show in message header vs. message list is different, which is quite confusing.

Summary: Malformed mail with multiple From headers should use first header (problem on any header defined as max number=1, for example From:, To:. first header should be used) → Malformed message with multiple headers of same type (but RFC 5322 max-number=1) should use first header in message header and message list consistently (first From:, To:, Date: etc. should be used)
Summary: Malformed message with multiple headers of same type (but RFC 5322 max-number=1) should use first header in message header and message list consistently (first From:, To:, Date: etc. should be used) → Malformed message with multiple headers of same type (but RFC 5322 max-number=1) should use first header in message reader and message list consistently (first From:, To:, Date: etc. should be used)
Summary: Malformed message with multiple headers of same type (but RFC 5322 max-number=1) should use first header in message reader and message list consistently (first From:, To:, Date: etc. should be used) → Malformed message with multiple headers of same type (but RFC 5322 max-number=1) should use first header in message reader, message list, replies, filtering etc. consistently (only first From:, To:, Date: etc. should be used)
Summary: Malformed message with multiple headers of same type (but RFC 5322 max-number=1) should use first header in message reader, message list, replies, filtering etc. consistently (only first From:, To:, Date: etc. should be used) → For malformed message with multiple headers of same type (but RFC 5322 max-number=1), TB should only use the first header instance consistently (show/use only the first From:, To:, Date: etc. in message reader, message list, replies, filtering etc.)
Summary: For malformed message with multiple headers of same type (but RFC 5322 max-number=1), TB should only use the first header instance consistently (show/use only the first From:, To:, Date: etc. in message reader, message list, replies, filtering etc.) → For malformed message with multiple headers of same type (but RFC 5322 max-number=1), TB should only use the first header instance consistently (show/use only the first From:, To:, Date: etc. in message list, message reader, replies, filtering etc.)

Here's a minimal testcase which has duplicate headers for virtually everything.

Attachment #9209975 - Attachment description: First Subject header - Bug 705587 - Multiple headers of same type, only the first should be parsed (if RFC max-number=1).eml → Testcase-1.eml: Multiple headers of same type, only the first should be parsed (if RFC 5322 max-number=1)
Attachment #9209975 - Attachment filename: ug 705587 - Multiple headers of same type, only the first should be parsed (if RFC max-number=1).eml → Bug 705587 testcase - Multiple headers of same type.eml

Screenshot shows Testcase 1 with duplicate headers in source (relevant message list columns shown are subject, correspondents, and date).

  • inconsistent headers in message list vs message reader
  • inconsistent in msg reader: To/CC (wrongly showing both instances) vs. Bcc (showing first instance only)
  • Reply confusion: Attribution line uses second headers for XX wrote and the date
  • Reply wrongly includes 2nd instances of original From/To as reply recipients
  • Reply-all skips the CC recipients of the original message (should use first instance of original CC)

For developers' convenience, here's the details...
Only checkmarks and n/a are correct behaviour afasics.

Header Message list Message reader Replies Reply-All
From: 1st From ✔ 2nd From Reply goes to 1st & 2nd From, vs. "2nd From wrote: ..." Replies goes to 1st & 2nd From vs. "2nd From wrote ..."
Subject: 1st Subject ✔ 1st Subject ✔ 1st Subject ✔ 1st Subject ✔
Date: 1st Date 2nd Date 2nd Date "... wrote on 2nd Date"
To: 1st & 2nd To 1st & 2nd To n/a Reply recipients include: 1st & 2nd To
Cc: 1st & 2nd Cc not shown in msg list (bugs) n/a missing (reply-all fails to include any one of the original Cc recipients)
Bcc: 1st Bcc not shown in msg list (bugs) n/a n/a (by design no reply to original bcc, to prevent accidental exposure)

(Table done with Typora, thanks to Ryan for recommending that!)

(In reply to Thomas D. (:thomas8) from comment #4)

Confirming for 88.0a1 (2021-03-17) (64-bit).
We have inconsistent handling of malformed messages with multiple headers of same type (To, From, Date etc.) in spite of max-number=1.
Particularly, what we show in message header vs. message list is different, which is quite confusing.

Depends on: 1615064

This is the same as bug 310189.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: