79777532

Date: 2025-09-28 18:56:04
Score: 0.5
Natty:
Report link

i think the issue you're experiencing with deep-email-validator on AWS is likely due to outbound port restrictions on SMTP ports (typically 25, 465, or 587) used for mailbox verification. AWS EC2 instances block port 25 by default to prevent spam, and ports 465/587 may require explicit security group rules or EC2 high-throughput quota requests for unblocking. This prevents the library's SMTP probing step, causing all validations to fail after basic syntax/MX checks. Similar issues occur on other cloud platforms like GCP or Azure with firewall rules.

// (replace deep-email-validator usage):
const validator = require('validator');
const dns = require('dns').promises;
async function validateEmail(email) {
    // Syntax check
    if (!validator.isEmail(email)) {
        return { valid: false, reason: 'Invalid syntax' };
    }
    try {
        // MX record check (ensures domain can receive email)
        const domain = email.split('@')[1];
        const mxRecords = await dns.resolveMx(domain);
        if (mxRecords.length === 0) {
            return { valid: false, reason: 'No MX records (invalid domain)' };
        }
        return { valid: true, reason: 'Syntax and MX valid' };
    } catch (error) {
        return { valid: false, reason: `DNS error: ${error.message}` };
    }
}
// Usage
validateEmail('[email protected]').then(result =& gt; console.log(result));
Reasons:
  • RegEx Blacklisted phrase (1): Similar issue
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Mohammad Sh