Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    2

    Default 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?


  2. #2
    Member
    Join Date
    Sep 2004
    Posts
    47

    Default

    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.

  3. #3
    Registered User
    Join Date
    Aug 2005
    Posts
    2

    Default

    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

Similar Threads & Tags
Similar threads

  1. PHP processing problem - particular domains
    By Camarao in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 06-12-2008, 07:06 PM
  2. Mail Queue Behavior/Processing
    By kerriritter in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 04-07-2006, 08:31 PM
  3. Php Processing
    By rhenderson in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 09-29-2005, 01:58 PM
  4. PHP Form Processing Help
    By [JZ] in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 07-29-2004, 11:49 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube