#1  
Old 5th December 2011, 19:59
dgmufasa dgmufasa is offline
Member
 
Join Date: Oct 2011
Posts: 86
Thanks: 5
Thanked 1 Time in 1 Post
Default using PHP as a mail filter

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.

TIA
Reply With Quote
Sponsored Links
  #2  
Old 6th December 2011, 23:19
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,721 Times in 2,562 Posts
Default

http://www.postfix.org/FILTER_README.html

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

Code:
/usr/bin/php /path/to/your/script
(This assumes the PHP is located in /usr/bin/php - please adjsut this if necessary.)
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
dgmufasa (12th December 2011)
  #3  
Old 12th December 2011, 15:11
dgmufasa dgmufasa is offline
Member
 
Join Date: Oct 2011
Posts: 86
Thanks: 5
Thanked 1 Time in 1 Post
 
Default One last question ..

Quote:
Originally Posted by falko View Post
http://www.postfix.org/FILTER_README.html

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

Code:
/usr/bin/php /path/to/your/script
(This assumes the PHP is located in /usr/bin/php - please adjsut this if necessary.)
Below is the ISPConfig API call to create a filter for the mailbox. I need to use this in the program being written.

Quote:
try {
if($session_id = $client->login($username,$password)) {
echo 'Logged successfull. Session ID:'.$session_id.'<br />';
}

//* Set the function parameters.
$client_id = 1;
$params = array(
'server_id' => 1,
'type' => 'header',
'pattern' => 'hmmnoe@test.int',
'data' => 'data',
'action' => 'DISCARD',
'active' => 'y'
);

$filter_id = $client->mail_filter_add($session_id, $client_id, $params);
How can I fix this so that it calls the PHP script that you mention?
Reply With Quote
Reply

Bookmarks

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ubuntu and nginx delgado2061 Installation/Configuration 0 27th November 2011 23:36
installing squirrelmail on Debian with ispconfig3 saco721 Installation/Configuration 18 1st April 2011 17:57
add web site serr57 Installation/Configuration 18 13th April 2008 11:40
Filtering emails using Spamassassin and Clamav for Exchange 2000 Server Rocky Server Operation 19 11th March 2008 08:27
php script injections Grizzly General 21 18th July 2006 08:55


All times are GMT +2. The time now is 02:32.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.