Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Not a valid email address" #79

Open
flintforge opened this issue Oct 8, 2023 · 0 comments
Open

"Not a valid email address" #79

flintforge opened this issue Oct 8, 2023 · 0 comments
Assignees
Labels
bug Something isn't working triage

Comments

@flintforge
Copy link

Hi,
First many thanks for writing denomailer ! (This inner log:true option makes it very convenient to debug!)

Description of the bug

Writing emails to user@domain
with domain not being a FQDN with a TLD but a host
is a very convenient way to send signals to admins
and is usually the first try that I give to an SMTP lib.

So I'm sending emails to me@localhost : yes, that's a valid email address
("although ICANN highly discourages dotless email addresses[1]")

However the lib replies :
Error: No valid emails provided!
Which is a bit vague in regard to the address

Same goes for the sender address:
Error: The specified from adress is not a valid email adress.
a clearer message, however with two typos

A look at the validator email → email.ts:19
shows one regexp, which will eventually considers faulty ones as valid :

  • john..doe@example.org (double dot)
  • 1234567890123456789012345678901234567890123456789012345678901234+x@example.com > 64 bytes
  • and a few others invalid match/mismatch, see : https://en.wikipedia.org/wiki/Email_address

Validating email address is a complex expression. May I recommend :

  • using an external heavily tested library
  • adding an option to bypass the validity check of email address and just let the MTA do the job,
    by sending mail delivery status and/or simply rejecting them ?
@flintforge flintforge added bug Something isn't working triage labels Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

2 participants