Verify an e-mail-adress - syntax and dns

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ingo Linkweiler

    Verify an e-mail-adress - syntax and dns

    Has anyone a function/script to verify an e-mail-address?

    It should:
    a) check the syntax
    b) verify an existing mailserver or DNS/MX records

    ingo
  • Bjoern Schliessmann

    #2
    Re: Verify an e-mail-adress - syntax and dns

    Ingo Linkweiler wrote:
    b) verify an existing mailserver or DNS/MX records
    "Or"? That's two different things.

    If you don't know already: Even if you test all this, it is still
    possible that

    - the target mail account doesn't exist
    - the sender's IP is filtered by the server so he'll reject
    - the localpart has syntax errors (allowed chars in the localpart
    are up to the server)

    Regards,


    Björn

    --
    BOFH excuse #280:

    Traceroute says that there is a routing problem in the backbone.
    It's not our problem.

    Comment

    • Ingo Linkweiler

      #3
      Re: Verify an e-mail-adress - syntax and dns

      Bjoern Schliessmann schrieb:
      Ingo Linkweiler wrote:
      >
      >b) verify an existing mailserver or DNS/MX records
      >
      "Or"? That's two different things.
      >
      If you don't know already: Even if you test all this, it is still
      possible that
      >
      - the target mail account doesn't exist
      - the sender's IP is filtered by the server so he'll reject
      Yes, I know this.
      But its still better than not checking it.
      The script will be used as part auf a user registration page to avoid
      dummy-inputs like "jsfhsadgfa@hdh jdfhjh.net"

      Comment

      • Marc 'BlackJack' Rintsch

        #4
        Re: Verify an e-mail-adress - syntax and dns

        In <ef5nop$aoh$1@n ews01.versatel. de>, Ingo Linkweiler wrote:
        The script will be used as part auf a user registration page to avoid
        dummy-inputs like "jsfhsadgfa@hdh jdfhjh.net"
        The usual way to cope with this is sending out confirmation mails. No
        need to check if the address is syntactically correct beforehand.

        Ciao,
        Marc 'BlackJack' Rintsch

        Comment

        • Ingo Linkweiler

          #5
          Re: Verify an e-mail-adress - syntax and dns

          The usual way to cope with this is sending out confirmation mails. No
          need to check if the address is syntactically correct beforehand.
          yes, I do this allready. But it would be nice to do some checks before
          to avoid wrong user inputs.

          Comment

          • Bjoern Schliessmann

            #6
            Re: Verify an e-mail-adress - syntax and dns

            Ingo Linkweiler wrote:
            yes, I do this allready. But it would be nice to do some checks
            before to avoid wrong user inputs.
            What do you do if the user inputs a "wrong" address? If you reject
            with an error message, the medium intelligent user will enter
            something like

            sdjfgsdjhg@gmx. net

            as next try, circumventing your test.

            Regards,


            Björn

            --
            BOFH excuse #178:

            short leg on process table

            Comment

            • Ben Finney

              #7
              Re: Verify an e-mail-adress - syntax and dns

              Bjoern Schliessmann <usenet-mail-0306.20.chr0n0s s@spamgourmet.c omwrites:
              Ingo Linkweiler wrote:
              >
              yes, I do this allready. But it would be nice to do some checks
              before to avoid wrong user inputs.
              >
              What do you do if the user inputs a "wrong" address? If you reject
              with an error message, the medium intelligent user will enter
              something like
              >
              sdjfgsdjhg@gmx. net
              >
              as next try, circumventing your test.
              I believe Ingo is checking for the case where the user intended to
              enter a valid email address, and made a typing error resulting in a
              trivially invalid one.

              --
              \ "'Did you sleep well?' 'No, I made a couple of mistakes.'" -- |
              `\ Steven Wright |
              _o__) |
              Ben Finney

              Comment

              • Bjoern Schliessmann

                #8
                Re: Verify an e-mail-adress - syntax and dns

                Ben Finney wrote:
                I believe Ingo is checking for the case where the user intended to
                enter a valid email address, and made a typing error resulting in
                a trivially invalid one.
                Ah. Good intention, but the same applies: Typos in the localpart are
                not detectable. Typos in the domain part could mostly be easily
                corrected by hand, too.

                Regards,


                Björn

                --
                BOFH excuse #297:

                Too many interrupts

                Comment

                • Frithiof Andreas Jensen

                  #9
                  Re: Verify an e-mail-adress - syntax and dns


                  "Ingo Linkweiler" <ingo.bear_NOSP AM@freenet.dewr ote in message
                  news:ef5nop$aoh $1@news01.versa tel.de...
                  Bjoern Schliessmann schrieb:
                  Ingo Linkweiler wrote:
                  b) verify an existing mailserver or DNS/MX records
                  "Or"? That's two different things.

                  If you don't know already: Even if you test all this, it is still
                  possible that

                  - the target mail account doesn't exist
                  - the sender's IP is filtered by the server so he'll reject
                  >
                  Yes, I know this.
                  But its still better than not checking it.
                  The script will be used as part auf a user registration page to avoid
                  dummy-inputs like "jsfhsadgfa@hdh jdfhjh.net"
                  Why bother, you will loose anyway:

                  For those kind of sites demanding registration for trivial usage (i.e. most
                  sites do) I use my own domain controlled by myself - the adress is valid for the
                  confirmation mail then, after I got what I came for (or after I found out that
                  this site was a waste of time, which happens entirely too often), the adress is
                  not valid anymore.

                  Cuts down the spamvertising a lot!


                  Comment

                  • Steven D'Aprano

                    #10
                    Re: Verify an e-mail-adress - syntax and dns

                    On Sun, 24 Sep 2006 13:23:03 +0200, Ingo Linkweiler wrote:
                    >The usual way to cope with this is sending out confirmation mails. No
                    >need to check if the address is syntactically correct beforehand.
                    >
                    yes, I do this allready. But it would be nice to do some checks before
                    to avoid wrong user inputs.
                    Because you like reinventing the wheel and doing the same work twice?

                    By memory, in an thread about the same topic just a few days ago, Fredrik
                    Lundh posted a link to Perl's FAQs that suggests a method for "validating "
                    email addresses: treat it like a password and ask the user to type it
                    twice. That will protect against simple typos and input errors.

                    For everything else, send to it and see what happens.


                    --
                    Steven D'Aprano

                    Comment

                    • Christophe

                      #11
                      Re: Verify an e-mail-adress - syntax and dns

                      Steven D'Aprano a écrit :
                      By memory, in an thread about the same topic just a few days ago, Fredrik
                      Lundh posted a link to Perl's FAQs that suggests a method for "validating "
                      email addresses: treat it like a password and ask the user to type it
                      twice. That will protect against simple typos and input errors.
                      I hate that thing. When I see that, I type my email once and copy/paste
                      into the second edit box. This is useless AND annoying at the same time.

                      Comment

                      • Steve Holden

                        #12
                        Re: Verify an e-mail-adress - syntax and dns

                        Christophe wrote:
                        Steven D'Aprano a écrit :
                        >
                        >>By memory, in an thread about the same topic just a few days ago, Fredrik
                        >>Lundh posted a link to Perl's FAQs that suggests a method for "validating "
                        >>email addresses: treat it like a password and ask the user to type it
                        >>twice. That will protect against simple typos and input errors.
                        >
                        >
                        I hate that thing. When I see that, I type my email once and copy/paste
                        into the second edit box. This is useless AND annoying at the same time.
                        Probably safe to say it's a little less useful when the text field
                        contents are visible, but the classic validator for hidden fields.

                        It might surprise you to realise that not everyone in the world is a
                        touch typist, and for them (since they are often looking at the keyboard
                        rather than the screen) it's not an unreasonable validator.

                        regards
                        Steve
                        --
                        Steve Holden +44 150 684 7255 +1 800 494 3119
                        Holden Web LLC/Ltd http://www.holdenweb.com
                        Skype: holdenweb http://holdenweb.blogspot.com
                        Recent Ramblings http://del.icio.us/steve.holden

                        Comment

                        • Georg Brandl

                          #13
                          Re: Verify an e-mail-adress - syntax and dns

                          Christophe wrote:
                          Steven D'Aprano a écrit :
                          >By memory, in an thread about the same topic just a few days ago, Fredrik
                          >Lundh posted a link to Perl's FAQs that suggests a method for "validating "
                          >email addresses: treat it like a password and ask the user to type it
                          >twice. That will protect against simple typos and input errors.
                          >
                          I hate that thing. When I see that, I type my email once and copy/paste
                          into the second edit box. This is useless AND annoying at the same time.
                          It may be for you, but there certainly are users that misspel their
                          e-mail address more frequently, just like passwords. And therefore it's a
                          nice touch to spare both the original submitter and the owner of the
                          misspelled address more work.

                          Georg

                          Comment

                          • Christophe

                            #14
                            Re: Verify an e-mail-adress - syntax and dns

                            Georg Brandl a écrit :
                            Christophe wrote:
                            >Steven D'Aprano a écrit :
                            >>By memory, in an thread about the same topic just a few days ago,
                            >>Fredrik
                            >>Lundh posted a link to Perl's FAQs that suggests a method for
                            >>"validating "
                            >>email addresses: treat it like a password and ask the user to type it
                            >>twice. That will protect against simple typos and input errors.
                            >>
                            >I hate that thing. When I see that, I type my email once and
                            >copy/paste into the second edit box. This is useless AND annoying at
                            >the same time.
                            >
                            It may be for you, but there certainly are users that misspel their
                            e-mail address more frequently, just like passwords. And therefore it's a
                            nice touch to spare both the original submitter and the owner of the
                            misspelled address more work.
                            Which proportion of the people that sometimes misspell their e-mail also
                            use cut&paste when faced with "please type your e-mail twice" web pages?

                            Comment

                            • Christophe

                              #15
                              Re: Verify an e-mail-adress - syntax and dns

                              Steve Holden a écrit :
                              Christophe wrote:
                              >Steven D'Aprano a écrit :
                              >>
                              >>By memory, in an thread about the same topic just a few days ago,
                              >>Fredrik
                              >>Lundh posted a link to Perl's FAQs that suggests a method for
                              >>"validating "
                              >>email addresses: treat it like a password and ask the user to type it
                              >>twice. That will protect against simple typos and input errors.
                              >>
                              >>
                              >I hate that thing. When I see that, I type my email once and
                              >copy/paste into the second edit box. This is useless AND annoying at
                              >the same time.
                              >
                              Probably safe to say it's a little less useful when the text field
                              contents are visible, but the classic validator for hidden fields.
                              >
                              It might surprise you to realise that not everyone in the world is a
                              touch typist, and for them (since they are often looking at the keyboard
                              rather than the screen) it's not an unreasonable validator.
                              Well, if they have a hard time using a keyboard, I've no doubts they
                              will love using cut&paste to cut nearly in half the time needed to fill
                              out your form :)

                              Comment

                              Working...