using PHP as a mail filter

Discussion in 'Programming/Scripts' started by dgmufasa, Dec 5, 2011.

  1. dgmufasa

    dgmufasa New Member

    Hello all,

    How can one attach .php code to a mail filter? The idea being that when an email arrives, it will "trigger" the php code to work on it.

  2. falko

    falko Super Moderator Howtoforge Staff

    You can use a simple shell script and call your PHP script from it as follows:

    /usr/bin/php /path/to/your/script
    (This assumes the PHP is located in /usr/bin/php - please adjsut this if necessary.)
  3. dgmufasa

    dgmufasa New Member

    One last question ..

    Below is the ISPConfig API call to create a filter for the mailbox. I need to use this in the program being written.

    How can I fix this so that it calls the PHP script that you mention?

Share This Page