Open Bug 1213748 Opened 9 years ago Updated 2 years ago

Mailaddresses with exclamation mark like !foo@bar.com are quoted ("!foo"@bar.com), but ! is regular localpart character per RFCs

Categories

(MailNews Core :: MIME, defect)

x86_64
Windows 7
defect

Tracking

(Not tracked)

REOPENED

People

(Reporter: klaus-martin.hansche, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

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

Steps to reproduce:

Start a new mail dialog.
Search for blasuele in addressbook. (LDAP)
Use result '!blasuelz@redacted'
Compose mail.
Send mail.



Actual results:

Mailserver says mail-address '"!blasuelz"@redacted' (single quotes by me) is not deliverable.
This happens since 38.0.


Expected results:

Mail-address shouldn't be quoted this way.
OS: Unspecified → Windows 7
Hardware: Unspecified → x86_64
Component: Untriaged → MIME
Product: Thunderbird → MailNews Core
Keywords: regression
According to RFC 5322, "!" is not a valid character for a bare local part. So the local part must be quoted. The mail server is broken.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
Summary: Mailaddresses like !blasuelz@redacted are wrongly quoted. ("!blasuelz"@redacted) → Mailaddresses with exclamation mark like !blasuelz@redacted are wrongly quoted. ("!blasuelz"@redacted)
Sorry, "!" was a valid character as written in the duplicated bug. (I don't remember why I got the wrong idea.)
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INVALID → ---
! is valid in UUCP bang path addressing so should be quoted no?
RFC 976 does not require quoting for hybrid addresses such as a!b@c.d.
another mime regression?
Regression if it worked in TB 24.
Latest rfc5322 : https://tools.ietf.org/html/rfc5322
> addr-spec       =   local-part "@" domain
> local-part      =   dot-atom / quoted-string / obs-local-part
> dot-atom        =   [CFWS] dot-atom-text [CFWS]
> dot-atom-text   =   1*atext *("." 1*atext)
> atext           =   ALPHA / DIGIT /    ; Printable US-ASCII
>                     "!" / "#" /        ;  characters not including
>                     "$" / "%" /        ;  specials.  Used for atoms.
>                     "&" / "'" / "*" / "+" / "-" / "/" / "=" / "?" /
>                     "^" / "_" / "`" / "{" / "|" / "}" / "~"

Email address in Tb's address book : (all special chars of atext except !)
  #$%&'*+-/=?^_`{|}~@a.b.c
=> Localpart is not quoted correctly by Tb 53 as expected in Compose, Send Later.

It looks that "!" is missing in table for allowed special chars.
Was "!" added while change from rfc822 to rfc2822, or change from rfc2822 to rfc5322?
Looking at some tests, the existing behaviour is clearly desired and cemented-in in various tests:
https://dxr.mozilla.org/comm-central/rev/424cdd3c5239dd57a3110b6468bb79ca9d005eaa/mailnews/mime/jsmime/test/test_header_emitter.js#53-54

https://dxr.mozilla.org/comm-central/rev/424cdd3c5239dd57a3110b6468bb79ca9d005eaa/mailnews/mime/jsmime/test/test_header.js#206-208
https://dxr.mozilla.org/comm-central/rev/424cdd3c5239dd57a3110b6468bb79ca9d005eaa/mailnews/mime/jsmime/test/test_header.js#225-229

So the original author knew exactly what he wanted. This is deliberate. Sadly, the original author is mostly unavailable for comment these days.
Flags: needinfo?(Pidgeot18)
https://tools.ietf.org/rfc/rfc976.txt
https://en.wikipedia.org/wiki/UUCP

Why support of Bang path of UUCP is still needed/mandatory in Thunderbird?
Movemail account is a kind of UUCP? It's used in some Chat feature?
Flags: needinfo?(Pidgeot18)

Thunderbird User in Support Forum has same issue with exclamation mark.
They are using Xero accounting software and xero have issued an email address to use which includes exclamation mark.
Please see Support Forum: https://support.mozilla.org/en-US/questions/1329326

Quoted info from question:

I am using Xero accounting software and they have given us an email address to send bills to (so they appear in Xero).
The email address is: bills.!51!2r.ctftoyq2dkioxxto@xerofiles.com (nb. I have changed some alpha characters only to maintain security)
Thunderbird adds quotation marks to the first part of the email address when sending the email, so in the sent folder it appears as "bills.!51!2r.ctftoyq2dkioxxto"@xerofiles.com. It looks like the email is sent but it is never received by Xero.

There are no spaces before or after the email address. I have tried copying & pasting and typing it out manually etc. Nothing works.
It appears to be the "!" in the email address that is causing issue. If I delete the two "!" from the email address it appears in the sent box as bills.512r.ctftoyq2dkioxxto@xerofiles.com not as "bills.512r.ctftoyq2dkioxxto"@xerofiles.com.

Xero won't give me an email address without the "!".

Anyone know if this will ever be fixed? I have same problem.

Summary: Mailaddresses with exclamation mark like !blasuelz@redacted are wrongly quoted. ("!blasuelz"@redacted) → Mailaddresses with exclamation mark like !foo@bar.com are quoted ("!foo"@bar.com), but ! is regular localpart character per RFCs

Per Anje's comment 11, this has enterprise-relevance as exclamation mark is used e.g. in Xero accounting software.

On Mac version 78.9.1 it sends the email without error code, but the email is never delivered.
On Ubuntu version 78.7.1 it errors with Restricted characters in address, but appears in the send folder but again email never delivered.

I also need this for Xero, beginning to wish I had stayed with Sage :(

(In reply to Andrew from comment #15)

On Mac version 78.9.1 it sends without errors and email is delivered as expected ** ( email without error code, but the email is never delivered. )**
On Ubuntu version 78.7.1 it errors with Restricted characters in address, but appears in the send folder but again email never delivered.

I also need this for Xero, beginning to wish I had stayed with Sage :(

Another person in Support Reporting a problem with ! used in email address.
https://support.mozilla.org/en-US/questions/1336728

One of the email addresses is for Xero

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.