martyndavies / legit Goto Github PK
View Code? Open in Web Editor NEWNodeJS library for checking MX records exist on a domain
License: MIT License
NodeJS library for checking MX records exist on a domain
License: MIT License
Domains like sharklasers.com
are well-known to belong to non legit senders โ guerrilla mail in this case. Is there any plan in legit to go beyond MX to include blacklists and whatnot? Else, any suggestions?
Best!
When evaluating an NPM package I like to take a quick peek at the source code. The NPM page for this package doesn't link to this repo, so I had to search through Github to find it.
Passes as legit via package, but when trying to email the account, it is not found.
I tried sending an email directly to [email protected] and I received a failure to send. I then passed the email through the validation using nodejs implementation and it passed validation
test: function (req, res) {
var checkEmail = require('legit');
checkEmail('[email protected]', function(validation, addresses, err) {
if (validation) {
console.log('This is a real email that can accept emails!');
console.log(JSON.stringify(addresses));
} else {
console.log('This domain cannot accept emails, you might want to remove it.');
}
});
},
On localhost everything works great, but on a test server I get this:
Error validating email: Error: Error: queryMx EREFUSED gmail.com
at QueryReqWrap.dns.resolveMx [as callback] (/srv/node_modules/legit/src/index.js:13:16)
at QueryReqWrap.onresolve [as oncomplete] (dns.js:213:10)
My usage:
async function getInvalidEmails(emails) {
let invalidEmails = [];
const promises = emails.map(async (email) => {
await legit(email)
.then((result) => {
if (!result.isValid) invalidEmails.push(email);
})
.catch((err) => {
console.log('Error validating email: ', err);
invalidEmails.push(email);
});
});
await Promise.all(promises);
return invalidEmails;
}
Any reasons why this might happen?
Seems you only verify domain, but not subdomain of email.
Is there a reason or a technical limitation ?
Hi and thank you for your package module.
i installed and try legit, then uninstall it.
npm r legit
npm uninstall legit
but at start server time, there is an error with legit concerned message:
webpack is watching the files...
internal/modules/cjs/loader.js:638
throw err;
Error: cannot find module 'legit'
there is no 'legit reference code in source code, i did search with "rg" linux tool application but nothing relative to legit in my code...
Maybe the process to uninstall the package has something wrong/dirty ?
How to fix that, please ?
I like this. Do you have a recommendation on how to process, say, 1000 emails? Does this only check the domain MX records? Maybe I should dedupe the domain first and just check that?
Unfortunately this module can't resolve all legit domains. For example orangelv.com is considered unresolved despite the fact that it has MX records.
The error says:
{ [Error: queryMx ENODATA] code: 'ENODATA', errno: 'ENODATA', syscall: 'queryMx' }
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.