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:artz@mydomain.com  artz@gmail.comartz2@mydomain.com artz@yahoo.comNow 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 its working. But its not.Anyone can see a light for my problem?Thanks!
Create a Filter for Postfix on Virtual Mails
postfix;filter
You can use mimedefang configured as smtpd_milter with postfix. It can change/add/delete headers (action_change_header/action_insert_header/action_delete_header) and append text (append_text_boilerplate) to the mails. More info here