Alaska Software Inc. - checking for mail server using xb2net
Username: Password:
AuthorTopic: checking for mail server using xb2net
Nestor G. Torreschecking for mail server using xb2net
on Fri, 06 May 2011 17:52:17 +0200
Hi All

If I am given an email address and I would only like to know if it is 
associated to a valid email server how would I do that using xb2net?

Kind regrards
Nestor
Rudolf ReinthalerRe: checking for mail server using xb2net
on Sat, 07 May 2011 11:39:16 +0200
Hello,
activate the logfile and take a look into it, you see the response from 
the server :
nCode := XseeStringParam(0, SEE_LOG_FILE, @cLogFile)


regards
Rudolf

Am 06.05.2011 17:52, schrieb Nestor G. Torres:
> Hi All
>
> If I am given an email address and I would only like to know if it is
> associated to a valid email server how would I do that using xb2net?
>
> Kind regrards
> Nestor
>
Nestor G. TorresRe: checking for mail server using xb2net
on Sat, 07 May 2011 14:34:47 +0200
Hi All,

After a little bit of experimentation and reading the xb2help I came up with 
a possible solution which is very quick.
The solution is to strip away the "username@" from the email address and 
then check the rest for a valid domain/host name.
If the domain/host name is valid on the internet then the chances that the 
email address provided is good is probably 90% ...
that would not be a bad hit rate. Please let me know if I am being simple 
mined or maybe I am not getting it.

Follows simple email address vetting solution:

//***** XBSOCKET TEST FOR DOMAIN/HOST  NAME EXISTENCE

   oSocket := xbSocket():new()


   aResult := oSocket:GetHostByName("softwareclinic.co.za")
   If Empty(aResult)
       msgbox("Failed")
   Else
       msgbox("Good: "+aResult[HOSTENT_CNAME])
   Endif

Kind regards,
Nestor


"Nestor G. Torres" wrote in message 
news:66dbabf9$457702e0$58f@news.alaska-software.com...
> Hi All
>
> If I am given an email address and I would only like to know if it is 
> associated to a valid email server how would I do that using xb2net?
>
> Kind regrards
> Nestor
>
Andreas Gehrs-Pahl
Re: checking for mail server using xb2net
on Sat, 07 May 2011 17:32:03 -0400
Nestor,

>After a little bit of experimentation and reading the xb2help I came up 
>with a possible solution which is very quick.
>The solution is to strip away the "username@" from the email address and 
>then check the rest for a valid domain/host name.

Because "GetHostByName()" is a Class Method, you don't need to instantiate 
an "oSocket" object with "oSocket := XbSocket():New()". But if you do, you 
should destroy it, after you are done with it. So the following code would 
be shorter and better:

	aResult := XbSocket():GetHostByName("softwareclinic.co.za")

But if you don't have internet access or the DNS server is out, you might
get a false negative, even with this simple test.

>If the domain/host name is valid on the internet then the chances that the 
>email address provided is good is probably 90% ...
>that would not be a bad hit rate. Please let me know if I am being simple 
>mined or maybe I am not getting it.

It completely depends on the source for your email address. Even if the
domain name exists, there is no way to tell if the actual email address
is valid, active, or who it belongs to. If you get the email address from
a customer, and you want to simply check if it isn't obviously wrong, you 
could check the following:

1) Does the domain name exist? (see above)
2) Does the email address only contains valid characters?

But to be sure that the email is really valid -- and even belongs to that
customer -- you would also need the following tests:

3) Can you send an email to that address or is it bouncing?
4) Does the recipient of the email send you a validation response?

Using only the first two tests will probably give you a 10% success rate 
at best, if you allow anonymous email address submissions, for example on
a web site. But if the customer stands right in front of you when telling 
you the email address -- or has something to gain from given you a valid 
email address -- the success rate will go up, and might reach something 
like 75% to 80%.

On the other hand, 87% of all statistics are made up on the spot, so I
really don't know how accurate any of this would be. 

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas.GP@Charter.net
       Andreas.Gehrs-Pahl@EJusticeSolutions.com
       Andreas@DDPSoftware.com
web:   http://www.Aerospace-History.net
Nestor G. TorresRe: checking for mail server using xb2net
on Sun, 08 May 2011 10:08:43 +0200
Hi Andreas,

Thank you so much for your constructive comments.

1) Valid characters and proper format of the email address is what I look 
for...so your point on that issue is covered. And thank you for clarifying 
that with this group.

2) Your additional simplification of GetHostByName call is an excellent 
observation. less cpu and code waist.

3)  I agree that that the domain name can only be checked using a adsl or 3g 
connection to the internet.
     And that yes the DNS server could be down giving us a bad connection 
reading; but that would not be
     the normal case.

4) Yes our customers are in front of the operators when these emails are 
captured; which is as you stated the best case for
     valid email capturing.

5) The process of validating email addresses to the hilt is to time 
consuming and would be counter productive.


So your guestament of 75- 80%  is still a very good hit rate for us.

Again thankyou for your thoughts which have helped me crystalize mine a bit 
more.

Kind Regards,
Nestor

"Andreas Gehrs-Pahl" wrote in message 
news:13frt742wytz2.pas8tuv1yu8k.dlg@40tude.net...
> Nestor,
>
>>After a little bit of experimentation and reading the xb2help I came up
>>with a possible solution which is very quick.
>>The solution is to strip away the "username@" from the email address and
>>then check the rest for a valid domain/host name.
>
> Because "GetHostByName()" is a Class Method, you don't need to instantiate
> an "oSocket" object with "oSocket := XbSocket():New()". But if you do, you
> should destroy it, after you are done with it. So the following code would
> be shorter and better:
>
> aResult := XbSocket():GetHostByName("softwareclinic.co.za")
>
> But if you don't have internet access or the DNS server is out, you might
> get a false negative, even with this simple test.
>
>>If the domain/host name is valid on the internet then the chances that the
>>email address provided is good is probably 90% ...
>>that would not be a bad hit rate. Please let me know if I am being simple
>>mined or maybe I am not getting it.
>
> It completely depends on the source for your email address. Even if the
> domain name exists, there is no way to tell if the actual email address
> is valid, active, or who it belongs to. If you get the email address from
> a customer, and you want to simply check if it isn't obviously wrong, you
> could check the following:
>
> 1) Does the domain name exist? (see above)
> 2) Does the email address only contains valid characters?
>
> But to be sure that the email is really valid -- and even belongs to that
> customer -- you would also need the following tests:
>
> 3) Can you send an email to that address or is it bouncing?
> 4) Does the recipient of the email send you a validation response?
>
> Using only the first two tests will probably give you a 10% success rate
> at best, if you allow anonymous email address submissions, for example on
> a web site. But if the customer stands right in front of you when telling
> you the email address -- or has something to gain from given you a valid
> email address -- the success rate will go up, and might reach something
> like 75% to 80%.
>
> On the other hand, 87% of all statistics are made up on the spot, so I
> really don't know how accurate any of this would be. 
>
> Andreas
> -- 
> Andreas Gehrs-Pahl
> Absolute Software, LLC
>
> phone: (989) 723-9927
> email: Andreas.GP@Charter.net
>       Andreas.Gehrs-Pahl@EJusticeSolutions.com
>       Andreas@DDPSoftware.com
> web:   http://www.Aerospace-History.net
Rudolf ReinthalerRe: checking for mail server using xb2net
on Sun, 08 May 2011 10:20:51 +0200
sorry, the logfile is from SEE4XB
regards
Rudolf
Am 07.05.2011 14:34, schrieb Nestor G. Torres:
> Hi All,
>
> After a little bit of experimentation and reading the xb2help I came up
> with a possible solution which is very quick.
> The solution is to strip away the "username@" from the email address and
> then check the rest for a valid domain/host name.
> If the domain/host name is valid on the internet then the chances that
> the email address provided is good is probably 90% ...
> that would not be a bad hit rate. Please let me know if I am being
> simple mined or maybe I am not getting it.
>
> Follows simple email address vetting solution:
>
> //***** XBSOCKET TEST FOR DOMAIN/HOST NAME EXISTENCE
>
> oSocket := xbSocket():new()
>
>
> aResult := oSocket:GetHostByName("softwareclinic.co.za")
> If Empty(aResult)
> msgbox("Failed")
> Else
> msgbox("Good: "+aResult[HOSTENT_CNAME])
> Endif
>
> Kind regards,
> Nestor
>
>
> "Nestor G. Torres" wrote in message
> news:66dbabf9$457702e0$58f@news.alaska-software.com...
>> Hi All
>>
>> If I am given an email address and I would only like to know if it is
>> associated to a valid email server how would I do that using xb2net?
>>
>> Kind regrards
>> Nestor
>>
>
Nestor G. TorresRe: checking for mail server using xb2net
on Sun, 08 May 2011 11:16:52 +0200
Hi Rudolf,

No apologies required....

Kind regards
Nestor


"Rudolf Reinthaler" wrote in message 
news:43eaedc6$2df056c7$c9a2@news.alaska-software.com...
> sorry, the logfile is from SEE4XB
> regards
> Rudolf
> Am 07.05.2011 14:34, schrieb Nestor G. Torres:
>> Hi All,
>>
>> After a little bit of experimentation and reading the xb2help I came up
>> with a possible solution which is very quick.
>> The solution is to strip away the "username@" from the email address and
>> then check the rest for a valid domain/host name.
>> If the domain/host name is valid on the internet then the chances that
>> the email address provided is good is probably 90% ...
>> that would not be a bad hit rate. Please let me know if I am being
>> simple mined or maybe I am not getting it.
>>
>> Follows simple email address vetting solution:
>>
>> //***** XBSOCKET TEST FOR DOMAIN/HOST NAME EXISTENCE
>>
>> oSocket := xbSocket():new()
>>
>>
>> aResult := oSocket:GetHostByName("softwareclinic.co.za")
>> If Empty(aResult)
>> msgbox("Failed")
>> Else
>> msgbox("Good: "+aResult[HOSTENT_CNAME])
>> Endif
>>
>> Kind regards,
>> Nestor
>>
>>
>> "Nestor G. Torres" wrote in message
>> news:66dbabf9$457702e0$58f@news.alaska-software.com...
>>> Hi All
>>>
>>> If I am given an email address and I would only like to know if it is
>>> associated to a valid email server how would I do that using xb2net?
>>>
>>> Kind regrards
>>> Nestor
>>>
>>
>