nodemailer / smtp-server

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

Add `resolver` option similar to mailauth resolver option #177

Open titanism opened 2 years ago

titanism commented 2 years ago

Right now it's not possible to pass a custom resolver function to resolve hostname lookup.

https://github.com/nodemailer/smtp-server/blob/2bd0975292208f1cf77d7a93cb3d8b3c4d48acb8/lib/smtp-connection.js#L214

The package mailauth supports a resolver option, and it would be helpful to have this across the entire smtp-server stack for DNS queries.

Thanks!

titanism commented 2 years ago

Also, you may want to catch the error code instead for dns.reverse errors thrown, e.g. https://github.com/omrilotan/reverse-dns-lookup/blob/main/index.js#L40.