I think honestly the second half of the script is unneccesary. In theory, it is meant to test whether that specific user address exists, but in reality, it will be fairly unreliable.bokehman wrote: Here it is in a function. In places it may seem like there is unnecessary code but this is because different mailservers give diffent response and this needs to be taken into consideration.
- Many virtual hosting companies use a catchall setting ("yes" to any @domain.com), and sort it after the fact
- Many mail servers use milters or addons that accept all @domain.com SMTP transactions, and reject non-matches *after* the fact with a bounce (because spammers do exactly what your script does)
To be fair, the top half of the script is a fairly nice checkdns/mxrr function, but the bottom half is going to half enough false positives as to be unreliable. Its basically an fsockopen/manual implementation of VRFY, to avoid the fact that everyone blocks VRFY (heh!), which many spammers already do.
So, nice for the top half, but I wouldn't bother with the bottom half.