I would like postfix to run a external php script (a hook) every time there is a outgoing delivery error.
For example, my webserver sends out emails and sometimes the recipients mailbox is full or nonexistent:
(host mx2.seznam.cz[77.75.76.32] said: 450 5.1.1 Mailbox is currently disabled. (in reply to RCPT TO command))
I would like to capture those errors through a script and notify my user that he needs to update his email address in our system.
Is it possible to get postfix to dump all of this information (email address, SMTP error) into a external script as they happen?
Thank you.