>Is it possible to have a PHP script receive an email (CSV text). The
problem is this, I want a server to send me an email, and then I want to
be able to have a PHP script 'listening' for email and then processing
the data in the email.
Is it possible to have a PHP script 'listening' or responding to an
'email received' event, so that it can process the data ?
The closest arrangement I know of that does this:
Run a SMTP server locally such as sendmail or exim that supports
".forward" files.
Install a ".forward" file that pipes the email into a
STANDALONE (command-line) php script (no web server involved).
E.g.
"|/usr/local/bin/emailreceiver.php"
The PHP script gets invoked with the email on stdin when an email
arrives. It is the responsibility of the script to skip over or
deal with the headers, and to filter out Viagra ads and bank phishing
spoofs that are not in the proper format for the data, and not to
open up security holes. The script also has to deal with the
possibility that it might be invoked multiple times concurrently
if multiple emails arrive at the same time (so use database locking,
etc.).
Gordon L. Burditt