EC-Nordbund / denomailer

A SMTP-Client implementation for deno (to send mails!)
https://deno.land/x/denomailer
MIT License
50 stars 16 forks source link

"Not a valid email address" #79

Open flintforge opened 10 months ago

flintforge commented 10 months ago

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 :

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