This is what I am trying to do:
I have a server using Postfix on a Ubuntu precise 64bits and I have a table list of emails in /etc/postfix/virtual, like this:
[email protected] [email protected]
[email protected] [email protected]
Now I want to put a filter that get all mails sent and add some prefix to the subject or add something else to the end of the mail.
In the file /etc/postfix/master.cf I put:
filter unix - n n - 10 pipe
flags=Rq user=filter argv=/home/filter/filtro.php -f ${sender} -- ${recipient}
I created the user filter and put the file /home/filter/filtro.php:
#!/usr/bin/php
<?php
$myFile = "/home/filter/testFile.txt";
$fh = fopen($myFile, 'a');
fwrite($fh, "\n-----------------------\n");
fwrite($fh, json_encode($_SERVER['argv']) );
?>
It was just to see if it´s working. But it´s not. Anyone can see a light for my problem?
Thanks!