You can do this using Exim and procmail. Check with your server administrator to find out how to use an Exim script on your server.
For example, I have the following .procmailrc file on one of the sites I have developed that processes a specific format of email and redirects those emails to a PHP script:
Code:
VERBOSE=off
#LOGABSTRACT=yes
SENDMAIL=/usr/sbin/sendmail
SHELL=/bin/sh
MAILDIR=$HOME/theFolder
LOGFILE=/home/*********/procmail.log
DEFAULT=$HOME/theFolder
#Get the subject discarding any leading and trailing blanks
#Note: On some systems -xSubject: has to be -x"Subject: "
SUBJ_=`formail -xSubject: \
| expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'`
:0:
* ^Subject:.*.Repair Order
{
:0 fwh
| formail -I"Subject: ${SUBJ_}"
:0c:
$DEFAULT
:0:
|/usr/bin/php -f /home/*******/public_html/scrape.php $LASTFOLDER
}
Then I set up a forwarder that forwards all mail sent to a specific email address to
Code:
|/usr/bin/procmail -v
It is a fun project that can get very complicated very quickly, but once it works, it is really exciting to make it so.
__________________
Be sure to click the reputation icon to give rep to the person who helped you.
For web design/development services, check
Silentium Designs.