RocketChat / RocketChat/Rocket.Chat

Transcribe From: e-mail regexp does not support TLD-s longer than 4 char

Open
#22,113 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

The transcript From: email gets parts cut off or mail is not sent when TLD should be longer than 4 char (like .casino, .luxury, .photo, .photography, .consulting, etc)
Part is getting cut off from something like rocketchat@subdomain.dmn.photo and ends up being rocketchat@subdomain.dmn

The regexp to check the e-mail does not support for TLD-s that can be longer than 4 characters due to this issue it cuts off the last part of "From: " if using something like subdomain.domain.photo.

Steps to reproduce:
  1. Set up e-mail with longer than 4 char TLD
  2. Send transcript
  3. Check From: address
Expected behavior:

Full From: address in e-mail headers

Actual behavior:

TLD is being cut off if domain part is short like 3-4 char.

Server Setup Information:

Server info irrelevant, as issue is in code base from it's creation commit.

Client Setup Information

Client info irrelevant, as issue is in code base from it's creation commit.

  • Desktop App or Browser Version: Firefox 88.0.1, Opera 76.0.4017.123, Chrome (Latest), Mac Desktop app, Windows Desktop app
  • Operating System: Windows 10 / ArchLinux / MacOS Big Sur
Additional context

Errors located here in regexp!
https://github.com/RocketChat/Rocket.Chat/blob/157b882d38b34b7b79dea527316554fe33f70891/app/livechat/server/lib/Livechat.js#L994

https://github.com/RocketChat/Rocket.Chat/blob/develop/app/livechat/server/lib/Livechat.js#L997

https://github.com/RocketChat/Rocket.Chat/blob/157b882d38b34b7b79dea527316554fe33f70891/app/livechat/server/lib/Livechat.js#L1079

https://github.com/RocketChat/Rocket.Chat/blob/develop/app/livechat/server/lib/Livechat.js#L1082

Relevant logs:

N/A
It is code error, location pointed out to you above.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the e-mail regexp in app/livechat/server/lib/Livechat.js around lines 997 and 1082. Reproduce the transcript with an address such as rocketchat@subdomain.dmn.photo and verify that the completed change preserves the full address in the From header for TLDs longer than four characters.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.