#1 (permalink)  
Old 08-27-2005, 02:01 PM
Registered User
 
Join Date: Aug 2005
Posts: 2
elck is on a distinguished road
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?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-27-2005, 05:15 PM
Registered User
 
Join Date: Sep 2004
Posts: 45
bpmod is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-28-2005, 12:12 PM
Registered User
 
Join Date: Aug 2005
Posts: 2
elck is on a distinguished road
Thanks Brian,

I have tried other solutions for a while that did not please me much.
I only started investigation this avenue a short while ago.

Thanks for saving me the 18 days!


Regards,

Elck
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 10:39 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc