note 16244 added to ref.mail
| From: | aulbach at unter dot franken dot de | Date: | Mon, 22 Oct 2001 13:31:22 +0000 |
| Subject: | note 16244 added to ref.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-19256@lists.php.net to get a copy of this message | ||
There are several explanations about mail(). Indeed the e-mail-protocol lacks of control. Why?
Ok, I can't explain it here in full details. But I try.
1. Testing, wether the mail-adress is correct is not possible: With the current model it is not in
every case possible to test, if a mail adress could be delivered (to the correct person). This is,
cause the most sendmail-programs don't have a standardized API to do this.
I have seen several tries to test a mail adress inside the PHP-Program. It can be proven, that it is
not possible to check all mail adresses with this method - it depends too much on the
sendmail-programs, why a mail adress can be sent or not. Even if you restrict e-mail adresses to the
form user@do.main (this cuts down the rules to check the mail adress) it's not possible to
guarantee for this.
For example I have seen several programs which test a mail adress for this regular expression:
^[a-zA-Z0-9.-_]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9]{2,3}$
They are testing for a mailadress with a toplevel domain of 2 or 3 chars. How about .info or .museum
which are proposed to be coming soon?
How about IPv6 adresses? Or maybe it would be possible to have the toplevel domain mail and the
owners allows to have such short adresses like aulbach@mail?
I have seen many of those regular expressions and they will fail all during the next 1-10 years.
Another example is, that those PHP-mail-adress-check-functions are coded too fast. Some
sendmail-programs are tested for several years.
2. There is no simple way to guarantee, if a mail has been sent: The mail protocoll defines the
store-and-forward-principle as it's standard. So it can't be synced inside a PHP-program.
It's only possible to say AFTER a while (any duration) that a mail has been sent or returned
with an error.
3. Cause of restriction 2) it's very difficult to find out, if a mail returned with an error. A
PHP-program has to get access to a own mailfolder. This complicated to configure on most servers.
Even it's difficult to read the errors. And it is a really hard problem to send the error
message to the user - he isn't online or many other problems.
All those problems are based on the way, how mail works. RFC 822 and so on are "too old".
Maybe a new type of mail-protocoll can be used for the needs we have. :-)
Indeed I think, PHP needs a interface to communicate via store-and-forward with a user. mail() is
just one method which currently works, but it's really not the best. :)
--
http://www.php.net/manual/en/ref.mail.php
http://master.php.net/manage/user-notes.php?action=edit+16244
http://master.php.net/manage/user-notes.php?action=delete+16244
http://master.php.net/manage/user-notes.php?action=reject+16244