The last step of my email validation looks like this: begin Mailer::deliver_complete(@user) rescue Net::SMTPFatalError @user.errors.add "email", "There was a problem with the verification of your email. Please check and try again." end It works great if the user puts in an invalid user with a valid domain, throwing the error as expected. However with an invalid domain, somehow it passes. How do I check to make sure that the email actually went through? ___________________ Ben Jackson Diretor de Desenvolvimento ben-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org http://www.incomumdesign.com
I never saw an answer to this post. Anyone have an idea what I can do to verify that an email _really_ works? Ben On Jun 14, 2005, at 8:12 PM, Ben Jackson wrote:> The last step of my email validation looks like this: > > begin > Mailer::deliver_complete(@user) > rescue Net::SMTPFatalError > @user.errors.add "email", "There was a problem with the verification > of your email. Please check and try again." > end > > It works great if the user puts in an invalid user with a valid > domain, throwing the error as expected. However with an invalid > domain, somehow it passes. How do I check to make sure that the email > actually went through? > ___________________ > Ben Jackson > Diretor de Desenvolvimento > > ben-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org > http://www.incomumdesign.com > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
I guess it''s practically impossible. The SMTP server can have a lot of reasons to reject en e-mail adress. I''m currently working on a "newsletter-mailing-application", we parse all e-mail addresses with TMail (to make sure all adresses are according to RFC) but there is no practical way (unless you want to do DNS queries etc) to check if an e-mail address realy works. Flurin Ben Jackson wrote:> I never saw an answer to this post. Anyone have an idea what I can do > to verify that an email _really_ works? > > Ben > > On Jun 14, 2005, at 8:12 PM, Ben Jackson wrote: > >> The last step of my email validation looks like this: >> >> begin >> Mailer::deliver_complete(@user) >> rescue Net::SMTPFatalError >> @user.errors.add "email", "There was a problem with the >> verification of your email. Please check and try again." >> end >> >> It works great if the user puts in an invalid user with a valid >> domain, throwing the error as expected. However with an invalid >> domain, somehow it passes. How do I check to make sure that the email >> actually went through? >> ___________________ >> Ben Jackson >> Diretor de Desenvolvimento >> >> ben-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org >> http://www.incomumdesign.com >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
On Jun 28, 2005, at 2:25 PM, Flurin Egger wrote:> Ben Jackson wrote: >> I never saw an answer to this post. Anyone have an idea what I can >> do to verify that an email _really_ works? > I guess it''s practically impossible. The SMTP server can have a lot > of reasons to reject en e-mail adress. I''m currently working on a > "newsletter-mailing-application", we parse all e-mail addresses > with TMail (to make sure all adresses are according to RFC) but > there is no practical way (unless you want to do DNS queries etc) > to check if an e-mail address realy works.DNS checks will only get you a little further than parsing addresses. There is no way to check whether an email was received. Your best bet is to set a bounce address which ''votes against'' an address. Mark the address invalid when it has, say, 2-3 bounces. Best, jeremy
on 6/28/2005 8:21 AM Ben Jackson said the following:> I never saw an answer to this post. Anyone have an idea what I can do > to verify that an email _really_ works?If you are testing e-mail functionality, you can send an e-mail to yourself. If you are testing a particular user''s address, nothing is 100% certain, see below.>> The last step of my email validation looks like this: >> >> begin >> Mailer::deliver_complete(@user) >> rescue Net::SMTPFatalError >> @user.errors.add "email", "There was a problem with the >> verification of your email. Please check and try again." >> end >> >> It works great if the user puts in an invalid user with a valid >> domain, throwing the error as expected. However with an invalid >> domain, somehow it passes. How do I check to make sure that the email >> actually went through? >This isn''t a rails question, it is an SMTP question. "It works great if the user puts in an invalid user with a valid domain," is only true for a restricted subset of "works," "user," "domain," and the implicit, "in my environment." Some hosts will silently accept mail even if there is no user of that name. Those host may throw the mail away, or collect it to a common account, or take some other action, that may or may not result in the intended user seeing it. Your mail may be sent through a relay before arriving at the destination host. The relaying host will not know if the user exists. The relaying host may not know if destination host exists. The destination host may not be accepting mail. This mail may be held on the relay. It may bounce back to you. The bounce may come minutes, hours or days after you initially sent the mail. In general there is no way to ensure that the mail went through, short of having the user perform some action (clicking on a link, replying) that confirms that they have received the e-mail.. Even if the user responds, there is no guarantee that they received the e-mail at the address that you have on file. You say that this is the last step of a validation. What are you trying to validate? Ray -- newsray-BRX9mXwdik5Wk0Htik3J/w@public.gmane.org http://www.warmroom.com
> "It works great if the user puts in an invalid user with a valid > domain," is only true for a restricted subset of "works," "user," > "domain," and the implicit, "in my environment."Good point ;)> You say that this is the last step of a validation. What are you > trying to validate?All I mean is that once we''ve determined that the email fits the standard regexp and is not blank, we wanted to know if the email actually went through. Apparently this is not possible, however. I guess we''ll have to settle with the possibility that our users might write "homail" instead of "hotmail", and there''s nothing we can do about it. Thanks for the thorough response, Ben
Any idea if there are ruby libraries I can use to do DNS lookups? Thanks, ben On Jun 28, 2005, at 7:07 PM, Jeremy Kemper wrote:> On Jun 28, 2005, at 2:25 PM, Flurin Egger wrote: >> Ben Jackson wrote: >>> I never saw an answer to this post. Anyone have an idea what I can >>> do to verify that an email _really_ works? >> I guess it''s practically impossible. The SMTP server can have a lot >> of reasons to reject en e-mail adress. I''m currently working on a >> "newsletter-mailing-application", we parse all e-mail addresses with >> TMail (to make sure all adresses are according to RFC) but there is >> no practical way (unless you want to do DNS queries etc) to check if >> an e-mail address realy works. > > DNS checks will only get you a little further than parsing addresses. > There is no way to check whether an email was received. Your best bet > is to set a bounce address which ''votes against'' an address. Mark the > address invalid when it has, say, 2-3 bounces. > > Best, > jeremy > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
> I guess we''ll have to settle with the possibility that our users might > write "homail" instead of "hotmail", and there''s nothing we can do > about it. Thanks for the thorough response,You could use something like this: http://www.serviceobjects.com/products/dots_email.asp Although it costs money, so it may not be an option. Best, David
Charles M. Gerungan
2005-Jul-01 18:01 UTC
Re: Email domain validation - Net::SMTPFatalError
Op 29-jun-2005, om 0:07 heeft Jeremy Kemper het volgende geschreven:>> I guess it''s practically impossible. The SMTP server can have a >> lot of reasons to reject en e-mail adress. I''m currently working >> on a "newsletter-mailing-application", we parse all e-mail >> addresses with TMail (to make sure all adresses are according to >> RFC) but there is no practical way (unless you want to do DNS >> queries etc) to check if an e-mail address realy works. > > DNS checks will only get you a little further than parsing > addresses. There is no way to check whether an email was > received. Your best bet is to set a bounce address which ''votes > against'' an address. Mark the address invalid when it has, say, > 2-3 bounces.Which brings you into the territory of mailing list managers. They do it all (for the OP). Just some sidestepping here ;). -- Regards, Charles.