473,386 Members | 1,795 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,386 software developers and data experts.

unavailable email question

Hi all,

we have many people that have registered to our newsletter and we are
getting every time more people who the email is unavailable. It's there any
technique to detect such unavailable address ?

We tought about using a special email (like ne********@ourdomain.com) then
using a PHP script to catch the returning email and catch some text on them
and decide if we remove the address from our mailing list or not. It's
possible with PHP ? It is the best solution ?

Thanks for answering.

Bob
Dec 18 '07 #1
11 1567
Bob Bedford wrote:
Hi all,

we have many people that have registered to our newsletter and we are
getting every time more people who the email is unavailable. It's there any
technique to detect such unavailable address ?

We tought about using a special email (like ne********@ourdomain.com) then
using a PHP script to catch the returning email and catch some text on them
and decide if we remove the address from our mailing list or not. It's
possible with PHP ? It is the best solution ?

Thanks for answering.

Bob
Sure, it's possible with PHP, and quite workable. Whether it's the best
solution only you can decide.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Dec 18 '07 #2
On 18 Dec, 12:26, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
You could set up a cron job testing for the following:
- find the MX record for the domain
- try a RCPT TO in a socket connection
- flag emailaddres as unavailable on error
- decide your logic wether to delete the emailaddres or recheck it
(perhaps a limited number of times) later

See the comments at:
<http://nl2.php.net/manual/en/function.getmxrr.php>
More improtantly see the Notes:
Note: This function should not be used for the purposes of address
verification. Only the mailexchangers found in DNS are returned,
however, according to >RFC 2821 when no mail exchangers are listed,
hostname itself should be used as the only mail exchanger with a
priority of 0.
Dec 18 '07 #3
On Tue, 18 Dec 2007 13:35:13 +0100, Captain Paralytic
<pa**********@yahoo.comwrote:
On 18 Dec, 12:26, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
>You could set up a cron job testing for the following:
- find the MX record for the domain
- try a RCPT TO in a socket connection
- flag emailaddres as unavailable on error
- decide your logic wether to delete the emailaddres or recheck it
(perhaps a limited number of times) later

See the comments at:
<http://nl2.php.net/manual/en/function.getmxrr.php>
More improtantly see the Notes:
Note: This function should not be used for the purposes of address
verification. Only the mailexchangers found in DNS are returned,
however, according to >RFC 2821 when no mail exchangers are listed,
hostname itself should be used as the only mail exchanger with a
priority of 0.
... which you can add yourself in the code or as last item to the returned
MX records if none exist/can be found. If you code with that fallback in
mind, I see no reason why you couldn't(/shouldn't from a technical
standpoint, load is something else) write a script that makes use of this
function to validate an emailaddress. True, it cannot be done by this
function _alone_, that's what IMHO this note is about.
--
Rik Wasmus
Dec 18 '07 #4

"Rik Wasmus" <lu************@hotmail.coma écrit dans le message de news:
op***************@metallium.lan...
On Tue, 18 Dec 2007 13:35:13 +0100, Captain Paralytic
<pa**********@yahoo.comwrote:
>On 18 Dec, 12:26, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
>>You could set up a cron job testing for the following:
- find the MX record for the domain
- try a RCPT TO in a socket connection
- flag emailaddres as unavailable on error
- decide your logic wether to delete the emailaddres or recheck it
(perhaps a limited number of times) later

See the comments at:
<http://nl2.php.net/manual/en/function.getmxrr.php>
More improtantly see the Notes:
Note: This function should not be used for the purposes of address
verification. Only the mailexchangers found in DNS are returned,
however, according to >RFC 2821 when no mail exchangers are listed,
hostname itself should be used as the only mail exchanger with a
priority of 0.

.. which you can add yourself in the code or as last item to the returned
MX records if none exist/can be found. If you code with that fallback in
mind, I see no reason why you couldn't(/shouldn't from a technical
standpoint, load is something else) write a script that makes use of this
function to validate an emailaddress. True, it cannot be done by this
function _alone_, that's what IMHO this note is about.
--
Rik Wasmus
Fantastic !!!!
This way an email address may be checked when a user register, right ?
I don't know what MX is, so I've to get on Internet a little bit to
understand what does this function. Also thanks for the link, that is
perfect for starting.

Maybe you can save me a lot of time searching: cant this function return an
unavailable mailbox but that does actually really exist ?

Cheers and thank you again.

Bob
Dec 18 '07 #5
Sure, it's possible with PHP, and quite workable. Whether it's the best
solution only you can decide.
Hi Jerry,

thanks for the anser,

the best solution I can decide for is with my knowledge only. You can see on
other responses that it seems to be a better solution that I didn't know.
Usually there is a better way if somebody know an other method. So asking if
it's the best way is usually to ask people having more experience if there
is a better one and in this case it seems there is.

Bob
Dec 18 '07 #6
Rik Wasmus wrote:
On Tue, 18 Dec 2007 13:35:13 +0100, Captain Paralytic
<pa**********@yahoo.comwrote:
>On 18 Dec, 12:26, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
>>You could set up a cron job testing for the following:
- find the MX record for the domain
- try a RCPT TO in a socket connection
- flag emailaddres as unavailable on error
- decide your logic wether to delete the emailaddres or recheck it
(perhaps a limited number of times) later

See the comments at:
<http://nl2.php.net/manual/en/function.getmxrr.php>
More improtantly see the Notes:
Note: This function should not be used for the purposes of address
verification. Only the mailexchangers found in DNS are returned,
however, according to >RFC 2821 when no mail exchangers are listed,
hostname itself should be used as the only mail exchanger with a
priority of 0.

.. which you can add yourself in the code or as last item to the
returned MX records if none exist/can be found. If you code with that
fallback in mind, I see no reason why you couldn't(/shouldn't from a
technical standpoint, load is something else) write a script that makes
use of this function to validate an emailaddress. True, it cannot be
done by this function _alone_, that's what IMHO this note is about.
Rik,

Because the check is not reliable. It is perfectly possible for the a
check like this to succeed but the mail still be bounced, for instance -
i.e. when the main mail server is just a mail proxy and passes the
message on to others to handle. In this case the proxy may accept
everything and later the "real" server can reject it.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Dec 18 '07 #7
On Tue, 18 Dec 2007 14:29:27 +0100, Bob Bedford <bo*@bedford.comwrote:
"Rik Wasmus" <lu************@hotmail.coma écrit dans le message de
news:
op***************@metallium.lan...
>On Tue, 18 Dec 2007 13:35:13 +0100, Captain Paralytic
<pa**********@yahoo.comwrote:
>>On 18 Dec, 12:26, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
You could set up a cron job testing for the following:
- find the MX record for the domain
- try a RCPT TO in a socket connection
- flag emailaddres as unavailable on error
- decide your logic wether to delete the emailaddres or recheck it
(perhaps a limited number of times) later

See the comments at:
<http://nl2.php.net/manual/en/function.getmxrr.php>
More improtantly see the Notes:
Note: This function should not be used for the purposes of address
verification. Only the mailexchangers found in DNS are returned,
however, according to >RFC 2821 when no mail exchangers are listed,
hostname itself should be used as the only mail exchanger with a
priority of 0.

.. which you can add yourself in the code or as last item to the
returned
MX records if none exist/can be found. If you code with that fallback in
mind, I see no reason why you couldn't(/shouldn't from a technical
standpoint, load is something else) write a script that makes use of
this
function to validate an emailaddress. True, it cannot be done by this
function _alone_, that's what IMHO this note is about.
Fantastic !!!!
This way an email address may be checked when a user register, right ?
I don't know what MX is, so I've to get on Internet a little bit to
understand what does this function. Also thanks for the link, that is
perfect for starting.

Maybe you can save me a lot of time searching: cant this function return
an
unavailable mailbox but that does actually really exist ?
Indeed it can, all sorts of network problems/time-outs/other stuff can
occur. That is why most servers will keep an 'undeliverable' message in a
queue, and periodically retry to send it before giving up. The way to
deploy it here would in my opinion be to flag a mailaddress as
unavailable, and only after repeatedly being flagged unavailable without a
success in between, flag it for possible deletion after a considerable
period of time (anything less then one day would be ridiculous, with some
slow DNS changes I would not recommend to set it lower then 3 days).

In my opinion, this is therefor unsuitable for email-validation when a
user registers (allthough it would probably work 99% or more of the time).
--
Rik Wasmus
Dec 18 '07 #8
On Tue, 18 Dec 2007 15:13:02 +0100, Jerry Stuckle
<js*******@attglobal.netwrote:
Rik Wasmus wrote:
>On Tue, 18 Dec 2007 13:35:13 +0100, Captain Paralytic
<pa**********@yahoo.comwrote:
>>On 18 Dec, 12:26, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
You could set up a cron job testing for the following:
- find the MX record for the domain
- try a RCPT TO in a socket connection
- flag emailaddres as unavailable on error
- decide your logic wether to delete the emailaddres or recheck it
(perhaps a limited number of times) later

See the comments at:
<http://nl2.php.net/manual/en/function.getmxrr.php>
More improtantly see the Notes:
Note: This function should not be used for the purposes of address
verification. Only the mailexchangers found in DNS are returned,
however, according to >RFC 2821 when no mail exchangers are listed,
hostname itself should be used as the only mail exchanger with a
priority of 0.
.. which you can add yourself in the code or as last item to the
returned MX records if none exist/can be found. If you code with that
fallback in mind, I see no reason why you couldn't(/shouldn't from a
technical standpoint, load is something else) write a script that makes
use of this function to validate an emailaddress. True, it cannot be
done by this function _alone_, that's what IMHO this note is about.

Because the check is not reliable. It is perfectly possible for the a
check like this to succeed but the mail still be bounced, for instance -
i.e. when the main mail server is just a mail proxy and passes the
message on to others to handle. In this case the proxy may accept
everything and later the "real" server can reject it.
Hmm, true, hadn't thought about 'accept everything' proxies...
--
Rik Wasmus
Dec 18 '07 #9
Indeed it can, all sorts of network problems/time-outs/other stuff can
occur. That is why most servers will keep an 'undeliverable' message in a
queue, and periodically retry to send it before giving up. The way to
deploy it here would in my opinion be to flag a mailaddress as
unavailable, and only after repeatedly being flagged unavailable without a
success in between, flag it for possible deletion after a considerable
period of time (anything less then one day would be ridiculous, with some
slow DNS changes I would not recommend to set it lower then 3 days).

In my opinion, this is therefor unsuitable for email-validation when a
user registers (allthough it would probably work 99% or more of the time).
--
Rik Wasmus
Thanks for informations Rik,

the email-validation would only be a "check". If it fails I may ask the user
to check again his email as the validation failed and then when he validate
again the address I save it. That's only for removing some mistyped emails
(even if I put 2 boxes and ask to write the email twice there is lot of
people typing email with errors).

I think I'll check the "undeliverable" email every month using only the
"undeliverable" emails.

Thank you again.

Bob
Dec 19 '07 #10

"Rik Wasmus" <lu************@hotmail.coma écrit dans le message de news:
op***************@metallium.lan...
On Tue, 18 Dec 2007 15:13:02 +0100, Jerry Stuckle
<js*******@attglobal.netwrote:
>Rik Wasmus wrote:
>>On Tue, 18 Dec 2007 13:35:13 +0100, Captain Paralytic
<pa**********@yahoo.comwrote:

On 18 Dec, 12:26, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
You could set up a cron job testing for the following:
- find the MX record for the domain
- try a RCPT TO in a socket connection
- flag emailaddres as unavailable on error
- decide your logic wether to delete the emailaddres or recheck it
(perhaps a limited number of times) later
>
See the comments at:
<http://nl2.php.net/manual/en/function.getmxrr.php>
More improtantly see the Notes:
Note: This function should not be used for the purposes of address
verification. Only the mailexchangers found in DNS are returned,
however, according to >RFC 2821 when no mail exchangers are listed,
hostname itself should be used as the only mail exchanger with a
priority of 0.
.. which you can add yourself in the code or as last item to the
returned MX records if none exist/can be found. If you code with that
fallback in mind, I see no reason why you couldn't(/shouldn't from a
technical standpoint, load is something else) write a script that makes
use of this function to validate an emailaddress. True, it cannot be
done by this function _alone_, that's what IMHO this note is about.

Because the check is not reliable. It is perfectly possible for the a
check like this to succeed but the mail still be bounced, for instance -
i.e. when the main mail server is just a mail proxy and passes the
message on to others to handle. In this case the proxy may accept
everything and later the "real" server can reject it.

Hmm, true, hadn't thought about 'accept everything' proxies...
--
Rik Wasmus
This will anyway reduce the number of really undeliverable email as this is
actually the main problem. The opposite would be a harder problem (telling
is not available and in fact it is)....as we would delete such address and
the customer want to receive our newsletter.
Anyway we are aware that there is no magic way to know if an email is still
active or not but we may use the 2 solutions to check it (MX and also
analyse the returned emails).

Thank you
Dec 19 '07 #11
Bob Bedford wrote:
We tought about using a special email (like ne********@ourdomain.com)
then using a PHP script to catch the returning email and catch some text
on them and decide if we remove the address from our mailing list or
not. It's possible with PHP ? It is the best solution ?
ourdomain.com is a real domain name owned by Eurobox Ltd, St Petersburg.
If you're not affiliated with that company, then you should probably stop
including their e-mail address in your posts -- they might not appreciate
it. Domains example.org, example.com and example.net are registered
specifically for the purpose of providing examples -- use them.

Now, on to your question: include whatever From address you like. The
trick is in the "Return-Path" header. What you do is take the user's e-
mail address and massage it a bit to add a return path header to your
message:

$my_domain = 'example.com';
$their_address = 'f***@example.org';
$return_path = 'newsletter+'
. str_replace('@', '=', $their_address)
. '@' . $my_domain;
$headers .= "Return-Path: $return_path";

Now, if fr**@example.org's mail bounces, the error message should get sent
to "ne*************************@example.com". Most mail servers will by
default treat this as an alias for "ne********@example.com". If not, this
feature can normally be enabled using the mail server's "VERP" setting.

Now you can write a script to periodically scan through the incoming mail
for ne********@example.com, pick out "To" addresses that match the regular
expression "/^newsletter\+/i" and then transform them to determine the
problem e-mail account:

$to_addr = 'ne*************************@example.com';
if (preg_match('/^newsletter\+/i'))
{
$to_addr = preg_replace('/^newsletter\+/i', '', $to_addr);
list($to_addr, $dummy) = explode('@', $to_addr);
$at_pos = strrpos($to_addr, '=');
$to_addr[$at_pos] = '@';
echo "Bounce from $to_addr\n";
}

Now you might not want to instantly unsubscribe this person from the
mailing list. Sometimes e-mail addresses temporarily start to bounce, e.g.
the user's mailbox has gone overquota, but starts working again once they
delete a few large attachments.

An idea might be to simply record all bounces into your database so that
you can unsubscribe (or perhaps, "put on hold") contacts who have, say,
bounced more than four times in the last two months (the exact criteria
are up to you!). If they are important customers you could phone them up
to ask them to confirm which is the best e-mail address for you to send
the newsletter to.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 12 days, 23:15.]

Sharing Music with Apple iTunes
http://tobyinkster.co.uk/blog/2007/1...tunes-sharing/
Dec 20 '07 #12

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

Similar topics

0
by: Motherchucker | last post by:
I'm running FreeBSD and trying to install mod_php4-4.3.3 from an updated ports tree. When it tries to fetch libtool-1.4.3.tar.gz, I get the following output and it eventually fails. I ended up...
2
by: N.K. | last post by:
Hi, I'm using Tomcat 7.2 and I'm trying to deploy an aplication that uses JSP and servlets. I'm actually trying to duplicate a production server but can't get it right. In the directory...
14
by: Richard Støen | last post by:
Please help! We suddenly started getting the following error message when we try to run any asp.net web application on the web server : Server Application Unavailable The web application you...
2
by: Petr PALAS | last post by:
Hi, when I open ANY ASP.NET application on my computer I get this message: ---------------------------------------------------------------------------- ---- Server Application Unavailable ...
5
by: Ken Cox [Microsoft MVP] | last post by:
MS has posted this here: http://www.asp.net/faq/ms03-32-issue.aspx Fix for: 'Server Application Unavailable' Error after Applying Security Update for IE...
3
by: David Walker | last post by:
Hi, I've encountered a problem when installing the .Net framework version 1.0 on a Windows 2000 Server machine in a clustered environment. After I install the framework and try to run a simple...
3
by: Greg | last post by:
Lately I am getting the message: Web Page Unavailable While Offline. The Web Page You Requested Is Not Available Offline. To view this page click connect. This happens when I am not online. ...
0
by: Phinneas | last post by:
Howdy, I have multiple apps running on a pair of dual-processor Win2k IIS servers, neither of which are domain controllers. My users are experiencing fairly frequent (10-20 / day) "Server...
1
by: DR | last post by:
Unable to start TSQL Debugging. Could not attach to SQL Server Process on 'srvname'. The RPC server is unavailable. I get this error when I try to run a SQL Server Project with a CLR stored...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.