Execute PHP script on recieve e-mail

software development

#1

Howdy, folks!

I’m trying to hook up to a Humble Widget that I’m using to sell our game, and we have created a backend that we want to invite users to when they buy it.

The best we can get from Humble is an e-mail notification when a purchase is made. I have set up a cron task to check the account’s e-mail every 10 minutes and execute the appropriate response when it runs, but I don’t like the idea of customers having to wait up to 10 minutes after purchase to get the e-mail.

I found this article about how to execute scripts with sendmail, but it doesn’t seem to be working. Is this possible on Dreamhost servers? Possible at all on LAMP?

Thanks!


#2

There’s a piece your missing if you’re trying to get email from outside in to be processed by a script. Actually two pieces probably.

First you have to forward incoming mail from the email account to the shell account on your web server. Go to the mail filters section of the panel to get started. https://panel.dreamhost.com/index.cgi?tree=mail.filters& select an email address and click edit. if you want to forward all mail to that address to the script the best thing to do is create the filter with reverse logic. As in "First, forward emails without lkdjflsdkjfdlksjf in the subject to USERONSERVER on SEVERNAME and then stop. "

Second you need to set a .forward.postfix file on the server to forward incoming email to the script. See this wiki article: http://wiki.dreamhost.com/Email_to_Script