rust-email_address icon indicating copy to clipboard operation
rust-email_address copied to clipboard

ted.backer@gmail is a valid e-mail address?

Open CristianCapsuna opened this issue 10 months ago • 3 comments

The below prints true. Why is that?

use email_address::*;

fn main() {
    println!("{}", EmailAddress::is_valid("ted.backer@gmail"));
}

CristianCapsuna avatar Mar 02 '25 16:03 CristianCapsuna

This is valid because in RFCs, gmail may be a valid local domain name, it does not necessarily have to be a public domain.

al8n avatar Apr 04 '25 11:04 al8n

This sounds like something that would be useful for intranet application. Would it be possible to have an options that would make it more tailored to the activity of verifying e-mail addresses for website sign-ups?

CristianCapsuna avatar Apr 13 '25 16:04 CristianCapsuna

This sounds like something that would be useful for intranet application. Would it be possible to have an options that would make it more tailored to the activity of verifying e-mail addresses for website sign-ups?

I think you can review https://docs.rs/email_address/latest/email_address/struct.Options.html, if you are verifying e-mail addresses for website sign-ups, regex may be better.

al8n avatar Apr 13 '25 17:04 al8n