3 ms·
Yeah, looks like they're doing super-naive address validation: https://github.com/mfbx9da4/deep-email-validator/blob/master/src/regex/regex.ts https://github.c
by Veen 6y ago
Yeah, looks like they're doing super-naive address validation:
https://github.com/mfbx9da4/deep-email-validator/blob/master/src/regex/regex.ts https://github.com/mfbx9da4/deep-email-validator/blob/master...
- Arnt 6y agoOTOH, that code looks as if it'll find the vast majority of the problems more careful analysis could find, both simply and without bad consequences. All that happens if that naïve code fails is that it does an MX lookup that's bound to fail, and then the code returns a bad error message ("couldn't find MX" instead of more properly "syntax error in domain part").
- stevekemp 6y agoIf an MX record isn't present you can fall back on the A-record. (If, and only if, no MX record for the domain is present, treat the domain as if it had an MX record with the given domain as the target hostname and a preference value of 0)
- Arnt 6y agoIf you want to be pedantic... not in the relevant case, no. In the relevant case (the domain is syntactically invalid but the naïve check didn't discover that) the response without MX RRs already tells you that there won't be an A (or AAAA).