I would really appreciate if anyone could help me with this? I just killed the whole day today trying to solve this (and understand the cumbersome CP that Dreamhost has.) I also tried contacting their tech support that were less than helpful and just gave me this link.
OK, so here’s my task. I want to get my php script to be called (as a web callback) for each incoming email to my inbox, with the body, or at least subject line of such email. Simple, right? Well, I guess not …
Here’s what I’ve done:
I created an email account, say, email@example.com (obviously via Dreamhost CP.)
I then added a filter to that email account to forward it to my main shell account, let’s call it
I then added a text fille
/home/myacct1/mydomain.comdirectory that contains this:
| /usr/bin/php /home/myacct1/mydomain.com/php/cron_eml.php
And created the
cron_eml.phpfile that had this:
#!/usr/bin/php -q <? $kroot = dirname(__FILE__); chdir($kroot); $_SERVER['DOCUMENT_ROOT'] = dirname($kroot); //Need this just to test that my PHP script is invoked mail("firstname.lastname@example.org", "Test email", "This is a test\r\n", "From: TEST <email@example.com>"); ?>
I then tried sending an email to
firstname.lastname@example.org even though I can see that the email arrives, my php script doesn’t get called …
- When I send email, it appears in the “
- If I just invoke my php script via the web browser, as
mydomain.com/php/cron_eml.phpit works fine and sends out my test email.
- All references in the Dreamhost documentation of what I’m trying to do seem to have non-working links. Here’s one example. But I also found this post, that I’m basing my solution on.
- Is there a way to see an error log or something that can tell me what am I doing wrong here?
This all is very frustrating! So any help would be appreciated.