Closed Bug 910153 Opened 11 years ago Closed 11 years ago

[Email] email address in a plain message body is broken, when multiple sub domains present.

Categories

(Firefox OS Graveyard :: Gaia::E-Mail, defect)

ARM
Gonk (Firefox OS)
defect
Not set
major

Tracking

(blocking-b2g:leo+, b2g18 fixed, b2g18-v1.0.1 wontfix, b2g-v1.1hd fixed)

RESOLVED FIXED
blocking-b2g leo+
Tracking Status
b2g18 --- fixed
b2g18-v1.0.1 --- wontfix
b2g-v1.1hd --- fixed

People

(Reporter: leo.bugzilla.gaia, Assigned: asuth)

References

Details

(Whiteboard: [TD-83670])

Attachments

(2 files, 1 obsolete file)

STR:
1. Create an IMAP account.
2. Continue to Email -> Message box
3. Compose an Email
4. Enter an email address which has multiple sub domains.
   (ex: test@yahoo.co.in)
5. Send the email

Result: 
Open the sent email, complete email address is not anchored.
for the above example it enables the link to only  "test@yahoo.co"

Expected: 
complete email address should be recognized and should be allowed to select.

Note:
1. This happens only with the email which has plain body ( not an HTML message)
2. Reproduced in Gaia Master also.
Attached image Broken Email addresses
Picture shows the email addresses that are broken
Functionality issue , leo+
blocking-b2g: --- → leo+
Working on this issue.

In case of plain body, email addresses REGEX not verifying the multiple sub domains.
Working on the issue patch will be uploaded to soon.
QA Contact: psingapati
Assignee: nobody → psingapati
QA Contact: psingapati
Attached file Pointer to PR (obsolete) —
PR is raised to gelam, 
added multiple sub domains check to email address Regex.
https://github.com/mozilla-b2g/gaia-email-libs-and-more/pull/242
Attachment #796556 - Flags: review?(bugmail)
Comment on attachment 796556 [details]
Pointer to PR

Wow, I really did not look into our e-mail reg-exp enough there previously when I cleaned up the URL logic.

Your fix works but I realized there are a number of other cases we handle poorly.  Uppercase, IDN roots, etc.  Also, we need unit tests for these things.

So I've whipped up an alternate implementation that is based more on the regex we are using for URLs which does not try and generatively build the domain segments.  The main performance reason for this is that it lets us explicitly bound the length of the string the regexp will try and consume.  The (.[a-z]+)+ could consume an arbitrarily long string; the number of segments could be bounded, but since the segments could each be rather long, the worst-case performance scenario could get very bad.

I'll attach my pull request in one sec and ask you to review.
Attachment #796556 - Attachment is obsolete: true
Attachment #796556 - Flags: review?(bugmail)
Attachment #796864 - Flags: review?(psingapati)
Comment on attachment 796864 [details]
Pointer to Github pull request: https://github.com/mozilla-b2g/gaia-email-libs-and-more/pull/243

Marcus, if you'd like to take a look at this from a code perspective, that would be great.  Note that bug 858370 is where we want to get rid of these regexps, so our goal is not so much perfection as just avoiding any obvious bloopers.
Attachment #796864 - Flags: review?(mcav)
Comment on attachment 796864 [details]
Pointer to Github pull request: https://github.com/mozilla-b2g/gaia-email-libs-and-more/pull/243

Looks good to me; it works against any pathological cases I could come up with.
Attachment #796864 - Flags: review?(mcav) → review+
Comment on attachment 796864 [details]
Pointer to Github pull request: https://github.com/mozilla-b2g/gaia-email-libs-and-more/pull/243

Issue is working fine with the patch.
Thanks
Attachment #796864 - Flags: review?(psingapati) → review+
Uplifted 40f43a0b0e25b0cdeb6e7c82387d1fd2517c1ac6 to:
v1-train: cffe2b7d4f382a5c2239723f6598e19c8d9da732
v1.1.0hd: cffe2b7d4f382a5c2239723f6598e19c8d9da732
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: