How to scan emails with PHP

I process all emails through a PHP script that checks the To address against a database of valid addresses. If it exists, the rest of the script processes it. However, if it does not exist, how can I bounce off email, just like a server, if I didn't have a script? Thanks!

+4
source share
2 answers

It turns out that it was very easy to solve: just respond something in the PHP script (for example, β€œThis account does not exist.”), And the mail program daemon generates a return email with the result turned on,

0
source

Letters are received via smtp protocol, in your case, I also assume that on port 25 there is a service that will listen to a request for mail from external domains.

There are various ways to bounce a message.

-> bounce at smtp level, as in the case when u receives the list of recipients, check f or the identifier, and if it does not exist, give the answer 4xx. Bouncemai l is then automatically generated by the sender domain.

-> if you received mail from the say gmail.com domain, then you will need to establish a new connection with gmail with your extension, the same as sending new mail from your server to gmail.com.

0
source

All Articles