Hi there! Currently I am looking for a way to implement a bounce handler and I would like some 'best practices' advice. I have very little experience in using postfix but I came up with some ideas and want to get some comments on those.
An application sends out a bunch of e-mails with a varying return path (VERP) of the form bounce-some_identif...@mydomain.tld where some_identifier is a unique and random string. My idea is to have a python bouncehandler script that will parse all bounces and notify the application that certain e-mails did not arrive at their destination. To complete the puzzle I need the following: 1. Postfix needs to accept mail of the form bounce-some_identif...@mydomain.tld 2. Postfix needs to deliver this mail to a unix socket where the python bouncehandler is listening 3. The delivery of 2 is handled according to a certain protocol or specification For point [1] I guess the most easy way is to use regular expressions (PCRE) as mappings. I haven't looked into this yet, but I guess it shouldn't be that hard. Other mail for the same domain has to undergo 'normal delivery'. Links to good examples are welcome. For point [2] I think I need to add a line to master.cf and I need to tell Postfix to use this delivery agent for the matches of [1]. Finally (and on this I really would like some advice) this delivery has to be done in a certain way. For example directly passing the message like a pipe or maybe something more elaborate like using LMTP as a delivery protocol. What would you recommend? And, if you have some examples lying around of something similar setups/configurations, sharing this information would be greatly appreciated! Thanks in advance! David