My point is... why do you use IS_EMAIL() validator? because you want
to know if that email address is valid or not. why? probably because
you want your app to send the user an email, so to prevent it not to
arrive to its destiny it becomes important to make sure, that email
address is valid.
If the validator considers 'a...@d_-f.us' invalid, I would call it
success because that is not a valid email address, probably a typo.

Yes, we can never be sure that the inserted address is correct but in
many cases, we can determine with certainty, that the address is wrong
and prevent further errors. You probably agree with me that we should
do what we can to improve even if we can't solve a problem in all its
extent. If this is isn't obvious, I give you an example: all passwords
can be guessed and its hashes cracked, so what do you about it? do you
choose a short and simple password just because the system is not
perfect and all passwords can be guessed/all hashing mechanisms
cracked? don't think so, you choose a strong password, you do what you
can...

how about making a IS_REAL_EMAIL()?


On May 30, 7:16 am, mdipierro <[email protected]> wrote:
> +1
>
> On May 30, 1:12 am, Jonathan Lundell <[email protected]> wrote:
>
>
>
> > On May 29, 2010, at 9:39 PM, mdipierro wrote:
>
> > > The one your propose fails two of our tests:
> > > Failed example:
> > >    IS_EMAIL()('a...@d_-f.us')
> > > Expected:
> > >    ('a...@d_-f.us', None)
> > > Got:
> > >    ('a...@d_-f.us', 'enter a valid email address')
>
> > Underscores are not allowed, but we accept them because they've been used 
> > historically and there's no compelling reason (in a validator) to reject 
> > them. If we were actually allocating domain names, there'd be a reason do 
> > so, but we're not.
>
> > We should also keep in mind that there's no way we can guarantee that the 
> > address that gets typed in is correct (in the sense of not having a typo, 
> > even if it's syntactically correct). Mainly, we want to check that it 
> > "looks like" an email address, and err on the side of permissiveness.
>
> > > **********************************************************************
> > > File "gluon/validators.py", line 859, in __main__.IS_EMAIL
> > > Failed example:
> > >    IS_EMAIL()('local...@localhost')       # localhost as domain
> > > Expected:
> > >    ('local...@localhost', None)
> > > Got:
> > >    ('local...@localhost', 'enter a valid email address')
> > > **********************************************************************
>
> > > On May 29, 9:36 pm, blackthorne <[email protected]> wrote:
> > >>http://fightingforalostcause.net/misc/2006/compare-email-regex.php
>
> > >> Take it as a suggestion for a better email regex validator...

Reply via email to