-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deep email validator in the aws cloud shell / Lambda not working #76
Comments
Hi sairaja, I am also facing the same issue did you find any solution ? |
not sure if it will work but I have found using keepAlive fixes issues with lambadas that make external api calls: {
httpAgent: new http.Agent({ keepAlive: true, keepAliveMsecs: 10000 }),
httpsAgent: new https.Agent({ keepAlive: true, keepAliveMsecs: 10000 }),
timeout: 5000
} |
aws does not allow 25 outbound calls which is needed for smtp checks. |
This is what i've found as well while building Lambda's using AWS SST. Thanks @sfarkas1988 |
I'm unable to run the deep email validator in the aws cloud shell / Lambda.
Please suggest.
Getting SMTP timeout / SMTP false.
Below is the code used.
const emailValidator = require('deep-email-validator');
// Get the email address from command-line arguments
const emailToValidate = process.argv[2];
async function validateEmail(email) {
try {
const { valid, reason, validators, address } = await emailValidator.validate(email);
console.log('validating smtp',validators?.smtp.valid)
if (valid) {
console.log(
Email ${email} is valid and deliverable.
);// Proceed with sending the email
} else {
console.error(
Email ${email} is not valid. Reason: ${reason}
);// Handle the case where the email address is not valid
}
} catch (error) {
console.error(
An error occurred while validating the email: ${error.message}
);// Handle the error (e.g., log it or show an error message)
}
}
if (!emailToValidate) {
console.error('Usage: node validateEmail.js ');
process.exit(1);
}
validateEmail(emailToValidate);
This works completely fine in the local environment.
But fails in AWS Cloud Shell or AWS Lambda.
Please look into this issue.
The text was updated successfully, but these errors were encountered: