nus-cs2103-AY2425S1 / pe-dev-response

0 stars 0 forks source link

Create Person command allows adding of an invalid email address without throwing an error message. #3483

Open nus-pe-bot opened 1 day ago

nus-pe-bot commented 1 day ago

Screenshot 2024-11-15 at 16.17.05.png

Screenshot 2024-11-15 at 16.19.46.png

Attached are two examples of invalid email addresses that were added into MedDict.


[original: nus-cs2103-AY2425S1/pe-interim#2683] [original labels: severity.Medium type.FunctionalityBug]

Nigeltzy commented 13 hours ago

Team's Response

Hi! Thank you for the bug report and the observation.

Our team notes the two examples that you have provided us, namely "johnd@j1.j1.j1" and "1.1.1@11.11.11". We understand your concern and after review, our team believes that the email addresses you have provided are not to be considered invalid as they can be valid coupled with the fact that an email address's domain can be for that of a local domain name with no top level domain.

According to the internet standards and technical specifications for emails, namely the RFC (Request for Comments), both of the example emails you have provided are syntactically valid according to the requirements.

As noted in the specification, the domain portion can be liberal in syntax and actual addressing depends on external protocols like RFC 1034 and RFC 5321. If for e.g. 1j.1j is not a valid DNS domain, emails addressed to it may fail to route, but this does not make the email address invalid according to RFC 5322. On the other hand, even if 1.1.1 does not correspond to a recognized DNS domain name or TLD, this does not violate RFC 5322 and is still possibly a valid email.

If the application were to reject such emails, it would unnecessarily limit the range of possible emails that users may have to key in, and would contribute to overzealous input validation. As such, for the purpose of keying in a patient's or doctor's email, we believe that the syntactically valid emails provided are not to be considered a bug.

You may also view the following resources for reference: https://www.rfc-editor.org/rfc/rfc5322#section-3.4.1 https://www.rfc-editor.org/rfc/rfc5321 https://www.rfc-editor.org/rfc/rfc5322 https://github.com/nus-cs2103-AY2021S2/pe-dev-response/issues/3132 https://stackoverflow.com/questions/8641144/9999-com-is-it-a-valid-email-id?rq=3

Duplicate status (if any):

--