|
|||
|
processing mail in PHP
Hi,
I am trying to process some mail in PHP scripts and this is what I do now: I made a filter that saves mail with a subject title containing 'forum' in a cgi-bin directory. I run a cronjob that copies this file and changes the permissions with chmod. I would rather not use a cronjob, but process the mail the moment it is received. Is there a way to start a php script upon reception of mail? If this is the wrong place for this posting please don't be angry, but coul you tell me where to go?
|
|
|||
|
It took me 18 days to get an answer to this when I first got cPanel. I hope you haven't been searching that long.
The first thing you need to do is make sure that your script is working correctly. Then you need to set up a forwarder using the following syntax: |/bin/sh -c '/usr/bin/php /path/to/your/script.php >> /path/to/an/outputfile.txt' The >> and the output file are not strictly necessary, but will certainly help in debuging etc. Notice that the quotes are around everything from before /usr to after .txt as that is one argument passed to the shell (/bin/sh). I am not sure what the -c does, but it works in my forwards, so I haven't questioned or investigated it further. Hope this helps! Brian Last edited by bpmod; 08-27-2005 at 07:22 PM. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|