I am creating a python script to deliver local mail using various means. The problem is this:
- This script has to accept multiple virtual domains defined in /etc/postfix/virtual
- The script does the checking if the recipient is valid and the contents are as expected and exits with the appropriate code (4.x.x 5.x.x) if not
The problem is that I want the bounce to come from the recipient address (orig_to) or bounce@recipientdomain, is this possible?
Setup:
/etc/postfix/virtual:
@domain1 pymail
@domain2 pymail
@domain3 pymail
@domain4 pymail
@domain5 pymail
/etc/postfix/master: (contains)
pymail unix - n n - - pipe
flags=FR user=pymail argv=/path/to/script.py ${sender} ${recipient}
/etc/postfix/transport:
* pymail:
/etc/postfix/main.cf:
pymail_destination_recipient_limit = 1
transport_maps = hash:/etc/postfix/transport
virtual_alias_domains = domain1 domain2 domain3 domain4 domain5
virtual_alias_maps = hash:/etc/postfix/virtual