4 ms·
Making your app connect to random SMTP servers every time it needs to validate an email address doesn't seem like a good idea. Shared domains (gmail.com etc.)
by martinp 14y ago
Making your app connect to random SMTP servers every time it needs to validate an email address doesn't seem like a good idea.
Shared domains (gmail.com etc.) might even get you blacklisted if you flood the same SMTP servers over and over again.
- healthenclave 14y agoIs there a work around ? How about using proxy but I guess that adds another layer of complexity
- SudoAlex 14y agoUse a queue processor - but that's probably going too far for simple email validation. The simple work around - don't do it. This code is susceptible to Denial of Service problems similar to the URLField verify_exists option https://www.djangoproject.com/weblog/2011/sep/09/security-releases-issued/ https://www.djangoproject.com/weblog/2011/sep/09/security-re... - a malicious SMTP server could tarpit all your SMTP connections from Django leaving your site with no workers to process other requests. The email validation from an EmailField is designed to ensure that it could be a valid email address, not that it's a valid mailbox. Live with the limitation instead of trying to be too smart.