Open Bug 1900211 Opened 4 months ago Updated 23 hours ago

Wrong sender name shown for mailing list posts since 'Foo Bar via mailinglist' ends up in collected address as displayname

Categories

(Thunderbird :: Message Reader UI, defect, P2)

Thunderbird 127

Tracking

(thunderbird_esr115 unaffected, thunderbird127 affected, thunderbird128+ affected)

Tracking Status
thunderbird_esr115 --- unaffected
thunderbird127 --- affected
thunderbird128 + affected

People

(Reporter: KaiE, Assigned: mkmelin)

References

(Blocks 1 open bug)

Details

Using Daily 128

When receiving email from a certain mailing list, Thunderbird displays the wrong "From" and "To" fields.
According to the name shown, it claims that I am the sender, but my name is not contained anywhere in the email, and my email address is contained in the Received: headers from MTAs, only.

I get this display:
From Kai Engert via mailinglist <mailinglist@example.com>
To: Kai Engert via mailinglist

I have a theory what's happening.

Apparently, this mailinglist sometimes rewrites the From: email address, as it's common in some configurations to avoid DMARC delivery issues.
The mailing list software changes the "From:" field of the email, and replaces the original email address with the mailing list address, but it also adds the original sender "name" plus the word "via" plus "name of mailinglist".

I assume that at the time Thunderbird first saw an email from that mailinglist (which apparently was an email that was from myself),
Thunderbird collected mailinglist@example.com into the address book "collected addresses".

When it collected that address, it also assigned a display name.
Because that email was sent by me, it associated the name "Kai Engert via mailinglist" with the email address "mailinglist@example.com".

(I confirmed that I have such an entry in my address book.)

The email I received today has this From: header
From: some-other-name via mailinglist@example.com <mailinglist@example.com>

Apparently Thunderbird decided to NOT show the name from this specific email, but decided to use the name from the address book instead,
which is wrong and very misleading in this scenario.

Indeed, there's an underlying issue on how Thunderbird collects addresses and tries to "smartly" fill up the Display Name field.
This behaviour has always been present but only recently is more obvious since we finally fix the display of known VS unknown addresses in the message list in bug 243258.
We also added a preference in the settings to control the display settings.

I think Display Names shouldn't be pre-populated for collected addresses if the message comes from a mailing list.
Do we have a fail proof way to detect this scenario?

Probably https://searchfox.org/comm-central/rev/9154a515faba4ae8533e85edd2b9938bc0f361d2/mailnews/compose/src/MessageSend.sys.mjs#1190 should check compType Ci.nsIMsgCompType.ReplyToList and probably blank out displayName?

Summary: Wrong sender name shown for mailing list posts → Wrong sender name shown for mailing list posts since 'Foo Bar via mailinglist' ends up in collected address as displayname

Ben, can you take care of this?

Assignee: nobody → benc
Flags: needinfo?(benc)
Blocks: tb128found

(In reply to Alessandro Castellani [:aleca] from comment #3)

Ben, can you take care of this?

I can investigate, but you'd likely be better off with someone familiar with the code. I know next to nothing about compose and addressbook.

Suggested first step: Define the intended behavior.

In which scenarios should the stored display name get ignored, and the name from the current message be shown?

Should the fix consist of two changes?

  • ignore stored display name in certain situations
  • don't save he display in address book name in certain situation

If we want both of the above, do we also want automatic cleanup of existing wrong entries,
or do we accept that users of previous Daily/Beta versions must clean up manually?

(In reply to Kai Engert (:KaiE:) from comment #0)

I assume that at the time Thunderbird first saw an email from that mailinglist (which apparently was an email that was from myself),
Thunderbird collected mailinglist@example.com into the address book "collected addresses".

Close, but not quite. You must've written to somebody via somelist <mailinglist@example.com> and that's when the address and display name entered you address book. (The "Automatically add outgoing email addresses to" setting controls this.) So Magnus's suggestion in comment 18 seems like a good idea.

(In reply to Kai Engert (:KaiE:) from comment #5)

If we want both of the above, do we also want automatic cleanup of existing wrong entries,
or do we accept that users of previous Daily/Beta versions must clean up manually?

The latter. I don't think we should go through users' address books changing things.

Flags: needinfo?(benc)

Additionally:
The time to remove the display name is when composing a new message. And in fact the Reply List button already does this. The ordinary Reply button doesn't, but maybe it should if the address matches the list address.

In fact there's a preference which appears to do that: mail.override_list_reply_to. I'm not quite sure if that's the intent of bug 1382371 which put it there, but it seems to use the List-ID name instead of the From name when clicking on Reply [All].

(In reply to Geoff Lankow (:darktrojan) from comment #6)

You must've written to somebody via somelist <mailinglist@example.com> and that's when the address and display name entered you address book. (The "Automatically add outgoing email addresses to" setting controls this.)

You're right, I indeed have such a message in my sent folder.

I had viewed a message from the list, which has this to value:
"To: Kai Engert via mailinglist <mailinglist@example.com>"

I had replied to this message in the past.

I just tried to repeat the scenario with the latest pre-128 code.
I deleted the old entry from the collected addresses address book.

If I reply all, the message I'm composing also says "To: Kai Engert via mailinglist ..."

I think that confirms your theory.

So Magnus's suggestion in comment 18 seems like a good idea.

Comment 18? Did you intend to refer to comment 2 from this bug?

(In reply to Magnus Melin [:mkmelin] from comment #2)

Probably https://searchfox.org/comm-central/rev/9154a515faba4ae8533e85edd2b9938bc0f361d2/mailnews/compose/src/MessageSend.sys.mjs#1190 should check compType Ci.nsIMsgCompType.ReplyToList and probably blank out displayName?

Thanks for your suggestion. Good idea, but it's probably better to do it earlier, and also avoid that the outgoing email uses the displayname.
I'll check if I can find the place.

Ok, I should read Geoff's messages, he already gave additional thoughts in comment 7 and 8.

Further complication:

The message I was replying to does NOT have standard mailing list headers, like "List-ID:"

Because ither messages to that list DO have the header, I assume the reason for the missing header is:
I was also explicitly on CC of that message.

The message that was delivered into my mailbox was apparently the directly delivered copy because of the CC.

When I reply to that message, I do not get a "reply to list" button.
I have a reply and a reply all button.
The reply all button produces the "TO: Kai Engert via"

I assume that means we cannot solve the problem by checking for the ReplyToList flag?

I looked at other messages from that list, which contain the name of some other person,
like "To: other person via mailinglist ..."
and in which I was NOT on CC.

When replying to that message, a direct reply works fine, a reply list works fine (only the email address is used, not the displayed name).

However, when using "reply all", I get the "other person via mailinglist..." in To: of the outgoing message.

It's possible that this is NOT a regression in 128.

Using another profile, where I still use 115, I made sure that I don't have the list address in my address book.

When using reply all with 115, I get the same behavior. Message composer also shows "To: Kai Engert via mailinglist ..."

I didn't test actual sending (I don't want to spam that list), but I assume that would also result in the wrong collected address.

Based on the additional findings, I don't know if we could fix this at the time we're collecting addresses or composing a reply to all. Please let me know if you have an additional idea.

But regardless, I still think we should try to fix it at the time we're displaying a message.

Suggestion:
If a received message contains a List-Id: header
(or other identifiers that make it clear that it's a mailing list, not sure if those exist)
then:

  • Ignore the display name found in the address book
  • display the From: information that is found in the current message

Another scenario, which I think supports my suggestion from comment 15.

My address book contains an entry for the thunderbird planning mailing list.
The display name is set to "Thunderbird Planning".

When receiving emails from that list, I cannot see the real sender.

Despite the "From:" field containing the name of a person, Thunderbird doesn't show it, neither in the "From" header section, nor in the "From" column.

The scenario described in comment 16 is a regression.

With TB 115, I get the display name from the "From" header shown in all three places.

Keywords: regression

If I toggle the preference "show only display name for people in my address book",
I get the following behavior:

With the above setting enabled, I get display name "Thunderbird Planning", only
(which is the name from the address book entry).

With the above setting turned off, I get display name "Real name via Thunderbird Planning <planning@discuss.thunderbird.net>"

This seems wrong.

Should the same display name be shown in both scenarios?
Shouldn't the action of the pref be limited to switching off the display of the email address?

My expectation is that "Real name via Thunderbird planning" should be shown in both scenarios,
either with or without the email address.

So it seems the full meaning of
""show only display name for people in my address book"

is:
"For email addresses that are contained the address book, don't show the email address, only show the display name, and don't show the display name from the email, but rather show the display name that is stored in the address book."

For mailing list addresses, which the user has already sent to, this will result in automatic collection and showing the list name, not the sender name, for all messages that use a rewritten From address by the mailing list software.

This will be the default behavior, if I understand correctly, and affect everyone using mailing lists.

So, do we want to provide a fix, by changing the implementation, and even if the pref is set, show the "From" header display name for all messages that are apparently sent by a mailing list,
or do we expect users who wish to avoid this potential confusion to turn off this pref?

I see the default value for mail.showCondensedAddresses is false,
which is the configuration that prefers to show the header display name, apparently.

I don't understand why my profile had this pref set to true.
I'm taking back my concern regarding the default behavior.

I no longer claim the wrong "From" display name is a regression,
because the profile that I use with version 115 had this pref set to false,
and setting it to "true" gives me the same behavior in 115.

Keywords: regression
Version: unspecified → Thunderbird 127

Redirecting this to Magnus so he can tackle this as per his recommendation in comment 2.
This is a bit outside Ben's comfort zone.

Assignee: benc → mkmelin+mozilla

Magnus, can you adjust the severity and priority based on your understanding of this issue?

Flags: needinfo?(mkmelin+mozilla)
Severity: S2 → S3
Flags: needinfo?(mkmelin+mozilla)
Priority: P1 → P2
You need to log in before you can comment on or make changes to this bug.