-
Notifications
You must be signed in to change notification settings - Fork 18
Description
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 :
[email protected](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 ?