Hi postfix-arena ppl!
I've developed a simple PHP script that is supposed to capture returning mail
delivery errors ("Undelivered Mail Returned to Sender")
and mark on a database that the email address is bad. (100% legit traffic I
swear, I work for an ISP and hate spam / abuses as much as you do :|)
So at the end of my master.cf I've added the following:
myUndRetCustomFilter unix - n n - - pipe
flags=F user=vmail:vmail argv=/usr/local/bin/myUndRetCustomFilter.php
${sender} ${size} ${recipient}
and created a file /etc/postfix/myUndRetCustomFilter
with inside the definition:
[email protected] FILTER myUndRetCustomFilter:dummy
and then created the database with the command:
postmap /etc/postfix/myUndRetCustomFilter
it works ok when testing manually, from the command line, with the command:
/usr/local/bin/myUndRetCustomFilter.php <
Maildir/cur/1384946361.M523250P7714.linuxmailserver\,S\=3871\,W\=3978\:2\,
[email protected]
(where Maildir/cur/13849... is the email file with the "Undelivered Mail
Returned to Sender" error and attached the original email)
It also works ok when sending the same email directly to
[email protected] with an email client.
But with real traffic I can see in the syslog that the filter doesn't get
triggered.
My gut suggests me that emails generated by postfix itself:
[email protected] (Mail Delivery System)
bypass the master.cf filter rule.
If that's the case, do you know a way to enforce the processing of the custom
filter also for mailer-daemon ?
Other workarounds or alltogether solutions are as much greatly welcome :)
Thank you very much for supporting,
regards and have a nice day.
Mike