When replying to an email with an @ in the display name of the sender, the addresses from the original email are incorrectly formatted

UNCONFIRMED
Unassigned

Status

Thunderbird
Message Compose Window
UNCONFIRMED
3 years ago
4 months ago

People

(Reporter: zzz2002@gmail.com, Unassigned)

Tracking

37 Branch
x86_64
Windows 7

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

3 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0
Build ID: 20150212154903

Steps to reproduce:

receive an email with from address format as shown below.
reply to the email using either reply or reply all
message bounces undeliverable.



Actual results:

I receive an email with a from address in the following display form 
John Smith @17 <jsmith@example.com>
it may also have cc addresses in similar form.

when I try to reply the email's the outgoing "to" address is mangled into 
"\"John Smith\"@17jsmith"@example.com

If I reply all the "to" and "cc" addresses copied from the email are all mangled in the same way.


Expected results:

outgoing (to) address should have been correctly interpreted (jsmith@example.com).

Comment 1

3 years ago
Can you look at the message source (Ctrl+U) to see the actual encoding of the "From:" header?
Given that '@' is a special character, it has to be quoted according to the standard:

  From: "John Smith @17" <jsmith@example.com>

rather than

  From: John Smith @17 <jsmith@example.com>

(even with the latter form being invalid, it still appears that the <@> construct should be recognized by the parser, so apparently something is throwing it off).
Summary: When replying to an email the addresses from the original email are incorrectly formatted → When replying to an email with an @ in the display name of the sender, the addresses from the original email are incorrectly formatted
(Reporter)

Comment 2

3 years ago
All the addresses are apparently correctly quoted 
They follow the form "John Smith @17" <jsmith@example.com>

I had a slightly different example today. Sending from a Thunderbird account named "Postmaster@KLaM" whose email address is postmaset@klam.ca resulted in an outgoing address of Postmaster@KLaMpostmaster@klam.ca 
The address should have had the form "Postmaster@KLaM" postmaster@klam.ca
(Reporter)

Comment 3

3 years ago
As I am the admin for the mail server I could possible get the message from the mail store.
I can probably find the original message and the reply that could not be delivered due to the wrong to address being generated.
I would have to get the users permission as the message might contain confidential data.

Let me know if you need it.
This does NOT look like a bug in TB.

1) zzz2002, pls confirm if this bug also occurs in TB Safe Mode: Help > Restart with addons disabled.

2) Pls provide more detailed STR. We need to know exactly where you entered what:
- pls number your STR
- Tools > Account Settings > YourSendingAccount >
  display name, email address, reply-to (pls mention if quoted or not)
- if there's a need to send and reply, pls specify
- pls specify explicitly with which email app the original mail was sent and
- with which app the reply was made

3) Pls keep STR and actual results strictly separate:
- do not include actual results in STR
- do not include more/alternative STR in actual results; iow, you can link them up to STR by using the step number as in STR

In my tests, TB handles cases with or without quotes in Sender's display name correctly. Even replying to an unquoted display name correctly adds the quotes.

Maybe it's the mail server who cannot handle quoted display names containing an @ sign?
(Reporter)

Comment 5

3 years ago
Ran TB in safe mode - result is exactly the same.
Its not the server, I click on reply or reply all and the to address in the reply on screen is incorrectly formatted.

original sending email app unknown - probably outlook -> exchange
replying with Thunderbird -> postfix (submission port 587)
Actions
1) open email in inbox from (display) name John Smith @17
2) The address in the from field of the original email is  John Smith @17 <jsmith@example.com>
2) click on reply or reply all (doesn't make any difference)
3) what shows up in the to and/or the cc fields of the reply is  -
   "\"John Smith\"@17jsmith"@example.com
4) send email 
5) get undeliverable due to response from mail system - 5.5.1 unknown recipient ....

THESE ARE THE ONLY EMAIL THAT FAIL AND THEY ALL FAIL BECAUSE OF A MALFORMED TO ADDRESS.
IF I TYPE THE ADDRESS IN i.e. - jsmith@example.com  - they get delivered without any problems.
(In reply to zzz2002@gmail.com from comment #5)ort 587)
> Actions
> 1) open email in inbox from (display) name John Smith @17
> 2) The address in the from field of the original email is  John Smith @17
> <jsmith@example.com>
> 2) click on reply or reply all (doesn't make any difference)
> 3) what shows up in the to and/or the cc fields of the reply is  -
>    "\"John Smith\"@17jsmith"@example.com
> 4) send email 
> 5) get undeliverable due to response from mail system - 5.5.1 unknown
> recipient ....

If name = John Smith @17, and if mail address is jsmith@example.com, as you know, From: / To: header should be as follows.
  From: "John Smith @17" <jsmith@example.com>
  To: "John Smith @17" <jsmith@example.com>
Are following string in your comment shown at whene and when you did what?
   John Smith @1 (no quote)
   John Smith @17 <jsmith@example.com> (no quote for name)

Because mail data used in mail display/mail sennding is "data in message source" instead of string shown at UI of Tb, please show us exact message header data of message source.
For mail you generated, you can see messge source without actual sending of mail:
   "Send Later" at composition window, show message source of mail in Outbox of "Local Folders".

> "\"John Smith\"@17jsmith"@example.com

This is a known phenomenon when e-mial address in address book is set like next by mistake.
   email-addr = "John Smith@17" jsmith@example.com
      localpart      =  "John Smith@17" jsmith
      domaibpart =  example.com
   If email-addr in Address Boojk == "John Smith@17" <jsmith@example.com>, more complex string is generated.
   E-mail address field of Tb's Address Book is for email address(== a@b.c.d part of <a@b.c.d> in From: header).
   Name part of 'From: "John Smith @17" <jsmith@example.com>' is defined at Display Name field of address book.

.
Created attachment 8569667 [details]
testmsg1.eml: unquoted display name in sender [From: John Smith @17 <jsmith@example.com>]

So this is how the incoming msg described in comment 5 might look, missing quotes around special display name in From: sender field.
Created attachment 8569670 [details]
Re-testmsg1.eml:  Unquoted sender now correctly quoted [To: "John Smith @17" <jsmith@example.com>]

And this is the source of a TB reply to testmsg1, where TB correctly quotes the sender display name which was unquoted before.
Attachment #8569667 - Attachment description: testmsg1: unquoted display name with @ in sender.eml → testmsg1.eml: unquoted display name in sender [John Smith @17 <jsmith@example.com>]
Attachment #8569667 - Attachment description: testmsg1.eml: unquoted display name in sender [John Smith @17 <jsmith@example.com>] → testmsg1.eml: unquoted display name in sender [From: John Smith @17 <jsmith@example.com>]
Attachment #8569670 - Attachment description: Re-testmsg1: Unquoted sender now correctly quoted [To: "John Smith @17" <jsmith@example.com>] → Re-testmsg1.eml: Unquoted sender now correctly quoted [To: "John Smith @17" <jsmith@example.com>]
Attachment #8569670 - Attachment filename: Re Test msg1 Unquoted sender [From John Smith @17 (jsmith@example.com)].eml → Re-testmsg1 (unquoted display name).eml
So zzz2002, the above testcases work perfectly for me.

Iow, really there must be something wrong with the original message which you received in your inbox.
1) select received msg which exposes the problem when replying
2) Ctrl+U (or other actions > view msg source) to see msg source
3) copy header section (body is irrelevant unless it contains stuff which might be mistaken for a header); replace private data as required
4) File the exact header information here

The reply does fail along comment 5 when the original msg has something like this (as explained by WADA):
From: "John Smith @17" jsmith@example.com
Which might be a valid address, but it's not the intended address, so it's an error on the sender's side.
But I believe I could not reproduce exactly the reported result of comment 5.

From my tests, I still don't believe that this could be a bug in TB, which actually seems to handle the unquoted case with square brackets correctly. Not sure if we get it right for weird local parts which have inner quotes and such.
Example of grabled To: header due to wrong Email in address book.

   Display = ABC DEF
   Email    = "John Smith @17" <jsmith@example.com>
When mail is sent to this Mr. DEF, following To: was generated.
   To: "ABC DEF <\"\"John Smith @17\"" <"jsmith\"@example.com>

   Display = GHI JKL
   Email    = "John Smith @17" jsmith@example.com
When mail is sent to this Mr. JKL, following To: was generated.
   To: GHI JKL <"\"John Smith @17\" jsmith"@example.com>

   Display = 'nothing is set)
   Email    = "John Smith @17" jsmith@example.com
When mail is sent to this Mr. Smith , following To: was generated.
   To: "\"John Smith \"@17\" jsmith\"@example.com"

Following in comment #5 by bug opener is pretty similar to above.
> "\"John Smith\"@17jsmith"@example.com

Comment 11

4 months ago
duplicate of one of these https://mzl.la/2CE8she ?
You need to log in before you can comment on or make changes to this bug.