Script to determine valid email address by querying server

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

    Script to determine valid email address by querying server

    Hi, I'm looking for a reliable script that would connect to a host and
    somehow determine whether an email address is valid.

    since getmxrr() only gets the mx records..

    Links/pointers ?

    Mike

  • Simon

    #2
    Re: Script to determine valid email address by querying server

    [color=blue]
    > Hi, I'm looking for a reliable script that would connect to a host and
    > somehow determine whether an email address is valid.
    >
    > since getmxrr() only gets the mx records..
    >
    > Links/pointers ?
    >
    > Mike[/color]

    I don't think there is such a function/script.
    Otherwise mail harvesters would have used it a long time ago.

    If someone tries to access my domain and checks an email address I probably
    would not reply...

    Of course, I could be wrong.

    Simon.


    Comment

    • Arun

      #3
      Re: Script to determine valid email address by querying server

      Such a function exist. I have seen it somewhere.
      Some sites use this to check if the mail address is valid or not.
      But as you said a mail server can always deny the request.
      Guess most reply appropriately.


      Arun

      Comment

      • DJ Craig

        #4
        Re: Script to determine valid email address by querying server


        Arun wrote:[color=blue]
        > Such a function exist. I have seen it somewhere.
        > Some sites use this to check if the mail address is valid or not.
        > But as you said a mail server can always deny the request.
        > Guess most reply appropriately.
        >
        >
        > Arun[/color]

        You may be talking about finger, which does this, but very few servers
        are still running finger...it runs on TCP/IP port 79...to find out if a
        particular server is running finger, type this at a unix/linux command
        line:
        telnet whatever.com 79
        or type an IP address instead of whatever.com. But I doubt you will
        find any servers that still run finger, for security reasons.

        Comment

        • Simon

          #5
          Re: Script to determine valid email address by querying server

          [color=blue]
          > Such a function exist. I have seen it somewhere.
          > Some sites use this to check if the mail address is valid or not.
          > But as you said a mail server can always deny the request.
          > Guess most reply appropriately.
          >
          >
          > Arun[/color]

          Are you sure you are not talking about a regex to check if a email address
          is a _possible_ valid address?

          Like check for at least one '@' and at least one '.' after the '@' and so
          on?
          That's the only ones I know of that would work.

          Simon


          Comment

          • pdt256

            #6
            Re: Script to determine valid email address by querying server



            Comment

            • Simon

              #7
              Re: Script to determine valid email address by querying server


              "pdt256" <pdt256@gmail.c om> wrote in message
              news:1120570651 .419027.305070@ g47g2000cwa.goo glegroups.com.. .[color=blue]
              > http://www.regexlib.com/
              >[/color]

              Er..thanks but why the link?
              I didn't ask for it.

              Maybe you are confusing me for the op.

              Simon


              Comment

              • Bert Melis

                #8
                Re: Script to determine valid email address by querying server

                siliconmike wrote:[color=blue]
                > Hi, I'm looking for a reliable script that would connect to a host and
                > somehow determine whether an email address is valid.
                >
                > since getmxrr() only gets the mx records..
                >
                > Links/pointers ?
                >
                > Mike
                >[/color]

                Comment

                • Chung Leong

                  #9
                  Re: Script to determine valid email address by querying server

                  In theory, an SMTP server could respond to a RCPT TO request with a
                  error message if the account doesn't exist. I don't think that's how
                  most servers behave though.

                  Comment

                  • Malcolm Dew-Jones

                    #10
                    Re: Script to determine valid email address by querying server

                    siliconmike (siliconmike@ya hoo.com) wrote:
                    : Hi, I'm looking for a reliable script that would connect to a host and
                    : somehow determine whether an email address is valid.

                    : since getmxrr() only gets the mx records..

                    : Links/pointers ?


                    There are routines to test if an address has the correct _syntax_ to be
                    potentially usable, so it is worth while to look for that. The routines
                    should be checking the syntax based on what RFC 822 says is valid, so
                    those are the kinds of terms you need for your search, but sorry, I have
                    no links for php. (Perl e.g. has Data::Validate: :Email, and possibly
                    others).

                    As for confirming an address is actually in use by someone, unless you are
                    on a private lan and building a private, internal, application, then there
                    is no way to confirm the address is valid except by sending a confirmation
                    request to the address and asking them to respond.

                    In general you cannot assume any particular server will provide much
                    useful information when you contact them.

                    Invalid addresses are happily (well not happily) accepted by many servers
                    to prevent you learning what addresses are valid. Sometime all such
                    invalid addresses are even used as spam traps (i.e. if more than one mail
                    per day/week/hour to an invalid address then your ip is blocked or
                    bit-bucketted for a while).

                    Even valid addresses will, on some some systems, sometimes be forced to
                    cause an error after the data is received to prevent you learning they
                    were valid.



                    --

                    This space not for rent.

                    Comment

                    • siliconmike

                      #11
                      Re: Script to determine valid email address by querying server



                      Malcolm Dew-Jones wrote:[color=blue]
                      > siliconmike (siliconmike@ya hoo.com) wrote:
                      > : Hi, I'm looking for a reliable script that would connect to a host and
                      > : somehow determine whether an email address is valid.
                      >
                      > : since getmxrr() only gets the mx records..
                      >
                      > : Links/pointers ?
                      >
                      >
                      > There are routines to test if an address has the correct _syntax_ to be
                      > potentially usable, so it is worth while to look for that. The routines
                      > should be checking the syntax based on what RFC 822 says is valid, so
                      > those are the kinds of terms you need for your search, but sorry, I have
                      > no links for php. (Perl e.g. has Data::Validate: :Email, and possibly
                      > others).
                      >
                      > As for confirming an address is actually in use by someone, unless you are
                      > on a private lan and building a private, internal, application, then there
                      > is no way to confirm the address is valid except by sending a confirmation
                      > request to the address and asking them to respond.
                      >
                      > In general you cannot assume any particular server will provide much
                      > useful information when you contact them.
                      >
                      > Invalid addresses are happily (well not happily) accepted by many servers
                      > to prevent you learning what addresses are valid. Sometime all such
                      > invalid addresses are even used as spam traps (i.e. if more than one mail
                      > per day/week/hour to an invalid address then your ip is blocked or
                      > bit-bucketted for a while).
                      >
                      > Even valid addresses will, on some some systems, sometimes be forced to
                      > cause an error after the data is received to prevent you learning they
                      > were valid.
                      >[/color]

                      Oh ok.. well then another question is that whether I could rely on
                      getmxrr atleast to figure out whether the doman of the email address is
                      valid ? Is it a fully reliable means ?

                      Comment

                      • Gordon Burditt

                        #12
                        Re: Script to determine valid email address by querying server

                        >Oh ok.. well then another question is that whether I could rely on[color=blue]
                        >getmxrr atleast to figure out whether the doman of the email address is
                        >valid ? Is it a fully reliable means ?[/color]

                        If a domain has no MX record and it has no A record, a mail server
                        will not have any place to try to deliver it. In that sense, there
                        are no false negatives (the case of the domain registrar accidentally
                        taking down the domain because someone else's check bounced comes
                        under the heading of TRUE negative, at least for the short time
                        while the mess is straightened out, as real mail servers will fail
                        the mail also).

                        You can get TEMPORARY failures of DNS (timeouts on servers answering,
                        servers down, fiber cuts, servers not authoritative for stuff they
                        should be, etc.) but these errors can be distinguished from the
                        permanent errors (no such record here, final answer). I think PHP
                        lets you distinguish the errors.

                        Trying to send a bounce message, stopping short of sending a body,
                        can have plenty of false positives (server might not check name at
                        SMTP time), but there are enough true negatives (many of them DO
                        check) to make the check worth it beyond just checking the mx/a
                        records on the domain. You can also get "false" negatives: the
                        server accepts *NO* bounce messages period. I question whether you
                        want to accept mail from such a domain at all.

                        Gordon L. Burditt

                        Comment

                        • siliconmike

                          #13
                          Re: Script to determine valid email address by querying server



                          Gordon Burditt wrote:[color=blue][color=green]
                          > >Oh ok.. well then another question is that whether I could rely on
                          > >getmxrr atleast to figure out whether the doman of the email address is
                          > >valid ? Is it a fully reliable means ?[/color]
                          >
                          > If a domain has no MX record and it has no A record, a mail server
                          > will not have any place to try to deliver it. In that sense, there
                          > are no false negatives (the case of the domain registrar accidentally
                          > taking down the domain because someone else's check bounced comes
                          > under the heading of TRUE negative, at least for the short time
                          > while the mess is straightened out, as real mail servers will fail
                          > the mail also).[/color]

                          Well, then I can conclude that checking the existence of both MX and A
                          records and if none are found (no-such-records-here error) then to
                          invalidate the email address - is the way to go.
                          [color=blue]
                          >
                          > You can get TEMPORARY failures of DNS (timeouts on servers answering,
                          > servers down, fiber cuts, servers not authoritative for stuff they
                          > should be, etc.) but these errors can be distinguished from the
                          > permanent errors (no such record here, final answer). I think PHP
                          > lets you distinguish the errors.
                          >
                          > Trying to send a bounce message, stopping short of sending a body,
                          > can have plenty of false positives (server might not check name at
                          > SMTP time), but there are enough true negatives (many of them DO
                          > check) to make the check worth it beyond just checking the mx/a
                          > records on the domain. You can also get "false" negatives: the
                          > server accepts *NO* bounce messages period. I question whether you
                          > want to accept mail from such a domain at all.
                          >
                          > Gordon L. Burditt[/color]

                          Comment

                          • Geoff Berrow

                            #14
                            Re: Script to determine valid email address by querying server

                            I noticed that Message-ID:
                            <1120686378.880 099.231220@g43g 2000cwa.googleg roups.com> from siliconmike
                            contained the following:
                            [color=blue]
                            >Well, then I can conclude that checking the existence of both MX and A
                            >records and if none are found (no-such-records-here error) then to
                            >invalidate the email address - is the way to go.[/color]

                            It's all futile. The only valid email are ones which are read.

                            --
                            Geoff Berrow (put thecat out to email)
                            It's only Usenet, no one dies.
                            My opinions, not the committee's, mine.
                            Simple RFDs http://www.ckdog.co.uk/rfdmaker/

                            Comment

                            • Manuel Lemos

                              #15
                              Re: Script to determine valid email address by querying server

                              Hello,

                              on 07/05/2005 08:25 AM siliconmike said the following:[color=blue]
                              > Hi, I'm looking for a reliable script that would connect to a host and
                              > somehow determine whether an email address is valid.
                              >
                              > since getmxrr() only gets the mx records..[/color]

                              This class does exactly what you ask:




                              --

                              Regards,
                              Manuel Lemos

                              PHP Classes - Free ready to use OOP components written in PHP
                              Free PHP Classes and Objects 2025 Versions with PHP Example Scripts, PHP Tutorials, Download PHP Scripts, PHP articles, Remote PHP Jobs, Hire PHP Developers, PHP Book Reviews, PHP Language OOP Materials


                              PHP Reviews - Reviews of PHP books and other products


                              Metastorage - Data object relational mapping layer generator

                              Comment

                              Working...