I am trying to filter mail at the user level. I have CentOS and Postfix installed.
I managed to install a filter on the server and its working great, except, instead of filtering by user, all emails (sent and received) for all users are getting through the filter. (I want only emails sent to bounce@example.com to go through the filter).
I have added to master.cf
:
myhook unix - n n - - pipe flags=F user=nils_filter argv=/path to/postfix.php ${sender} ${size} ${recipient}
smtp inet n - - - - smtpd -o content_filter=myhook:
pickup fifo n - - 60 1 pickup -o content_filter=myhook:
main.cf
has:
smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/access,permit_mynetworks, reject_unauth_destination
and I updated the access
file with:
bounce@example.com FILTER myhook
After running postmap
and reloading, it is working for the entire example.com domain (all emails sent and received on smtp are getting piped through the filter I setup).
Could you point me in the right direction where I might be wrong?