Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Incorrect Email Validation and Persistent display of error message on message selection in MailExportForm

Open smritidoneria opened this issue 1 year ago • 14 comments

Description:

The validateEmail function does not correctly validate email addresses according to the RFC standard. The error message for the messagesCount field is persistently displayed whenever a message is selected.

Steps to reproduce:

  1. Go to export messages
  2. Write any invalid email.
  3. click on send

Expected behavior:

If an invalid email is entered, it should display an error. Additionally, if the message is not selected first and the send button is clicked, it should display an error. However, if the user then selects the message, the error should not be displayed.

Actual behavior:

https://github.com/user-attachments/assets/6a3ec43a-ede5-4f29-89d9-3d8ec40111c1

Server Setup Information:

  • Version of Rocket.Chat Server: 6.12.0
  • License Type: Enterprise
  • Number of Users: 2
  • Operating System: MacOs
  • Deployment Method: Docker
  • Number of Running Instances: 2
  • DB Replicaset Oplog: Enabled
  • NodeJS Version: 14.21.4
  • MongoDB Version: 7.0.5

Client Setup Information

  • Desktop App or Browser Version: Safari Version 17.5
  • Operating System: MacOs

Additional context

Relevant logs:

smritidoneria avatar Aug 03 '24 11:08 smritidoneria

If the issue is relevant, I want to work upon this

smritidoneria avatar Aug 03 '24 11:08 smritidoneria

Thanks for reporting.

Server: 6.12.0

I don't think so - 6.11 hasn't been released yet?

Please confirm the version.

function does not correctly validate email addresses

It looks like you mean it does not validate addresses at all?

reetp avatar Aug 04 '24 12:08 reetp

Rocket chat version-6.10.2

yes, the validator do not seems to render the email address properly

smritidoneria avatar Aug 04 '24 13:08 smritidoneria

Thanks for your work.

I have requested that this be reviewed.

Please note that this may take some time as it will have to go in the queue with lots of other work.

reetp avatar Aug 05 '24 08:08 reetp

FYI - Community Liaison (reetp) shared this with internal teams and we'll be working on it soon (including review to existing proposed PR)

casalsgh avatar Aug 05 '24 11:08 casalsgh

I have solved this issue if this is not resolved till now please assign it to me.

Starkz24 avatar Aug 08 '24 09:08 Starkz24

I have solved this issue if this is not resolved till now please assign it to me.

No one assigns issue here.

You are free to work on whatever you want.

However, please see the previous team response.

This already has a PR and is is under review by the team so look at other issues - feature requests is a good place, or look at apps.

reetp avatar Aug 08 '24 09:08 reetp

Dotless or no TLD emails are valid emails according to the most recent RFC regarding emails (RFC 5322), this is not a bug.

rique223 avatar Sep 23 '24 21:09 rique223

hey @rique223 , according to RFC 5322 , a general email pattern takes this form: local-part@domain

smritidoneria avatar Sep 24 '24 12:09 smritidoneria

hey @rique223 , according to RFC 5322 , a general email pattern takes this form: local-part@domain

Said it once. Please don't keep using @

People will get notifications regardless.

Thanks.

reetp avatar Sep 24 '24 13:09 reetp

hey @rique223 , according to RFC 5322 , a general email pattern takes this form: local-part@domain

Exactly, and the email in your video follows this pattern, was it supposed to be an example of an invalid email?

rique223 avatar Sep 24 '24 13:09 rique223

I have linked a pull request #33012 can you check that this resolve the problem

Starkz24 avatar Sep 24 '24 14:09 Starkz24

As per the comment here

https://github.com/RocketChat/Rocket.Chat/issues/32974#issuecomment-2369375668

Dotless or no TLD emails are valid emails according to the most recent RFC regarding emails (RFC 5322), this is not a bug.

And here:

https://github.com/RocketChat/Rocket.Chat/pull/33012#discussion_r1773484524

Top-level domains (.com, .org, etc) are not mandatory for an email to be considered valid, there is no need to change this regex as this was a purposeful decision on email validation done by our engineering team.

Although it seems a bit incongruous, user@domain is valid according to RFC 5322 and therefore this is not a bug and should be closed.

reetp avatar Sep 30 '24 09:09 reetp

This issue has been marked as stale because there has been no further activity in the last 10 days. If the issue remains stale for the next 4 days (a total of 14 days with no activity), then it will be assumed that the question has been resolved and the issue will be automatically closed.

github-actions[bot] avatar Oct 14 '24 12:10 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Oct 28 '24 18:10 github-actions[bot]