473,385 Members | 1,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

Jul 17 '05 #1
16 8070
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


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.
Jul 17 '05 #2
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

Jul 17 '05 #3

Arun wrote:
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


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.

Jul 17 '05 #4
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


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
Jul 17 '05 #5

"pdt256" <pd****@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
http://www.regexlib.com/


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

Maybe you are confusing me for the op.

Simon
Jul 17 '05 #7
siliconmike 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 ?

Mike

http://joemarini.com/tutorials/tutor...mainexists.php
Jul 17 '05 #8
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.

Jul 17 '05 #9
siliconmike (si*********@yahoo.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.
Jul 17 '05 #10


Malcolm Dew-Jones wrote:
siliconmike (si*********@yahoo.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.


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 ?

Jul 17 '05 #11
>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 ?


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
Jul 17 '05 #12


Gordon Burditt wrote:
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 ?
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).


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.

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


Jul 17 '05 #13
I noticed that Message-ID:
<11**********************@g43g2000cwa.googlegroups .com> from siliconmike
contained the following:
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.


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/
Jul 17 '05 #14
Hello,

on 07/05/2005 08:25 AM siliconmike said the following:
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..


This class does exactly what you ask:

http://www.phpclasses.org/emailvalidation
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #15
I bow down to your holy self.

Manuel Lemos wrote:
Hello,

on 07/05/2005 08:25 AM siliconmike said the following:
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..


This class does exactly what you ask:

http://www.phpclasses.org/emailvalidation
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html


Jul 17 '05 #16
Your script works fine, except at certain times it shows the message
"connecting" on the browse and halts for 40-60 seconds, before fetching
the result.

Mike

siliconmike wrote:
I bow down to your holy self.

Manuel Lemos wrote:
Hello,

on 07/05/2005 08:25 AM siliconmike said the following:
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..


This class does exactly what you ask:

http://www.phpclasses.org/emailvalidation
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html


Jul 17 '05 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Web Master | last post by:
Hi, I am having a little issue with Jacks Form mail php script. I have installed it and configured the form to get it to work, but for some bizarre reason I have 2 issues I can't seem to debug....
0
by: John Silver | last post by:
I have a perl script running on machine A, a web server. A visitor completes certain pieces of data and these are compiled into two emails, one addressed to the visitor and copied to the site...
16
by: Fox | last post by:
I merged and modified these script which work perfectly fine as long as I use server.execute to access the VBS part (which is itself in another ASP file). When these I use a session variable to...
6
by: S P Arif Sahari Wibowo | last post by:
Hi! I am thinking to have a client-side script doing processing on file downloading, basically the script will process a downloaded file from the server before it received by the user. For...
4
by: petermichaux | last post by:
Hi, I'm hoping for a reason I'm wrong or an alternate solution... I'd like to be able to dynamically include some javascript files. This is like scriptaculous.js library but their solution is...
5
by: Martin Larsen | last post by:
Hi, I have a script for a CMS that preloads an image by setting the SRC attribute. The problem is that the location of the image as seens from the final HTML page depends on whether the CMS has...
4
by: thanos | last post by:
Hello, I'm relatively new to PHP so I found this free contact us script on the net that i was going to use for my Contact Us php page. Its works pretty good except for error handling. I was...
6
by: BA | last post by:
Hi Everyone, I have an application that sits behind a server farm, the application needs to pass its NLB IP address in the message that it sends to another service. From C# code, how can I...
4
by: Ima Lozer | last post by:
I am in the process of writing an app for one of my sites that will allow guests to send e-cards to other folks. The process is fairly simple. First the sender selects a card graphic via a series...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.