Comment on Strings do too many things
ono@lemmy.ca 9 months agoChecking MX in your application means you needlessly fail on transient outages, like when a DNS server is rebooting or a net link hiccups. When it happens, this is likely to confuse or frustrate the user, will definitely waste their time, and may drive them away and/or generate support calls.
Also, MX records are not always needed for mail to be delivered.
Better to just hand the verification message off to your mail server, which knows how to handle these things. You can flag the address if your mail server refuses to accept it.
fubo@lemmy.world 9 months ago
If DNS is transiently down, the most common mail domains are still in local resolver cache. And if you’re parsing live user requests, that means the IP network itself is not in transient failure at the moment. So it takes a pretty narrow kind of failure to trigger a problem… And the outcome is the app tells the user to recheck their email address, they do, and they retry and it works.
If DNS is having a worse problem, it’s probably down for your mail server too, which means an email would at least sit in the outbound mail spool for a bit until DNS comes back. Meanwhile the user is wondering where their confirmation email is, because people expect email delivery in seconds these days.
So yeah … yay, tradeoffs!
(Confirmation emails are still important for closed-loop opt-in, to make sure the user isn’t signing someone else up for your marketing department’s spam, though.)