fredeil / email-validator.dart

A simple Dart class for validating email addresses (syntax) without using RegEx :email:
https://pub.dartlang.org/packages/email_validator
MIT License
194 stars 38 forks source link

Email with exactly three consecutive dots (example...@gmail.com) is validated as true despite being invalid #60

Closed MatthiasMAigner closed 1 week ago

MatthiasMAigner commented 1 month ago

Description:

Hello,

I've encountered an issue with the email validation logic in the plugin. According to email standards, an email with consecutive dots (e.g., example...@gmail.com) is not valid. However, when using the current version of the email validator plugin, an email with exactly three consecutive dots is being validated as true, while emails with two or four consecutive dots are correctly validated as false.

Steps to Reproduce: Use the email example...@gmail.com. Pass this email through the email validator function. The result returns true (valid), even though it should return false (invalid).

Expected Behavior: The email example...@gmail.com should return false, as consecutive dots are not allowed in the local part of the email address.

Actual Behavior: The email example...@gmail.com returns true, while example..@gmail.com and example....@gmail.com correctly return false.

Version: Plugin version: 3.0.0 It seems that this issue occurs specifically when there are exactly three consecutive dots in the local part of the email.

Thank you!

fredeil commented 2 weeks ago

Sorry for the late reply @MatthiasMAigner.

Seems to work correctly, can you provide the actual email that you're having problems with @MatthiasMAigner. All the examples you provided validates to false in my tests.

Ref:

image
fredeil commented 1 week ago

Closing