How can I "filter" postfix-generated bounce messages?

Solution 1:

In this case you do it too complicated. This is the easy way.

You need to have this (additional) in your main.cf:

notify_classes = resource, software, bounce, 2bounce
bounce_notice_recipient = [email protected]
2bounce_notice_recipient = [email protected]
transport_maps = hash:/etc/postfix/transport_maps   #or another file. See below.

in the /etc/postfix/transport_maps put

[email protected]    smtp:127.0.0.2:25

then postmap /etc/postfix/transport_maps. Afterwards postfix reload or restart Postfix.

This will notify the [email protected] user of all bounces and as this user is said to be transported through 127.0.0.2:25 you get all these mails through that server. Replace the addresses/IP/port according to your environment.