nodemailer / smtp-server

Create custom SMTP servers on the fly
Other
846 stars 145 forks source link

Invalid email addresses accepted despite docs saying they won't be #149

Closed americrypt closed 4 years ago

americrypt commented 4 years ago

On your website you state:

By default all sender addresses (as long as these are in valid email format) are allowed

And we can see some examples of invalid addresses here at the bottom of the page:

john.doe@.net | The domain name (domainsample) is missing after the @ symbol and before the top level domain (.net). john.doe43@domainsample | The top level domain (.co.uk) is missing.

Problem is, both of those examples of invalid addresses do get accepted:

mail from:<john.doe@.net>
250 Accepted
...
mail from:<john.doe43@domainsample>
250 Accepted

Is your website wrong in that you're not actually checking addresses, or is this a bug in the program?

andris9 commented 4 years ago

smtp-server accepts addresses that are valid by smtp syntax, it does not care if the address is otherwise valid (does the host exist or not etc). This is intentional to allow building servers for internal traffic with local addresses. For actual internet-compatible validation you might want to use something like @hapi/address

americrypt commented 4 years ago

@andris9 It would help greatly if you would allow people to finish editing their comments before you close their issue. This issue was open less than 5 minutes sir, please, I cannot type that damn fast.