fwd email to php script

fwd email to php script

Posted by: ushimitsudoki
Posted on: 2005-01-16 20:30:00

A 3rd party script I want to install requires that I set up an email address which forwards to a local PHP script.

One of the examples given in the script documentation is:
|php /home/yourlogin/scriptpath/script.php

There is also a ".procmailrc" example.

I contacted tech support, but they said that "this sort of issue is beyond the scope of tech support to solve for you".

Can anyone help with this?

Re: fwd email to php script

Posted by: ushimitsudoki
Posted on: 2005-01-21 01:10:00

Just a bump in hopes of a reply!

Re: fwd email to php script

Posted by: Mark
Posted on: 2005-01-22 15:37:00

Have you tried either of these, and are you having a problem with one of them?

Sounds like that's about how to do it. The easiest solution is probably to create a new user, and put the "|php /home/you/yourfile.php" line in a file called ".forward.postfix" in that user's home directory. All email directed at that user will then be forwarded to the PHP script.

If you don't want to create a new user, the procmail example would be better, as it would give you more control over what email goes to the PHP script. (eg. only email with a particular subject or destination address.)

Note that the control panel uses procmail to do its email filters, so you can't use the email filter control panel for a user whose email is being forwarded to procmail.

Re: fwd email to php script

Posted by: blueorder
Posted on: 2005-01-25 07:22:00

Mark,

I treid adding the line into .forward.postfix but the email bounces back with the error:

Command died with status 1:
"/usr/local/bin/php /home/[user]/keitai/wp-keitaimail.php"

Putting "|php /home/[user]/keitai/wp-keitaimail.php" returns a command not found, that's why I went with "|/usr/local/bin/php /home/[user]/keitai/wp-keitaimail.php"

blueorder

Re: fwd email to php script

Posted by: Mark
Posted on: 2005-01-25 23:32:00

ah, right... I remember now, someone mentioned PHP isn't installed on the mail servers.

Here's a thread over in the "programming" forum where people were talking about this same issue. (although that page says php *is* installed on the mail servers...)

Re: fwd email to php script

Posted by: blueorder
Posted on: 2005-01-26 04:44:00

Mark,

Thanks for the reply...unfortunately, I've tried that method also...I'm the last post on that thread...

blueorder

Tags: php scriptemail addressscript phpforwardsscopelocalhelp