Hi I have smtp server on a local network and all other local machines send emails through this one (mastersmtp.lo.cal 10.10.10.10).I need to rewrite all TO/destination address from test1.lo.cal (10.10.10.12) and abrakadabra.lo.cal (10.10.10.222) servers, which relay to my mastersmtp.lo.cal.I think this should be done on mastersmtp.lo.cal. it uses postfix as mail software.Maybe someone knows any most default/simple way of doing this?Thank you.
postfix rewrite destination of mails from specific server group
postfix;rewrite
used http://www.postfix.org/header_checks.5.html added to main.cf:# for redirection some emails  header_checks = pcre:/etc/postfix/header_checkscontent of: /etc/postfix/header_checks/^From: (.*@test1.lo.cal)/ REDIRECT newDestination@awesome.com/^Received: (.*10.10.10.12)/ REDIRECT newDestination@awesome.com/^From: (.*@abrakadabra.lo.cal)/ REDIRECT newDestination@awesome.com/^Received: (.*10.10.10.222)/ REDIRECT newDestination@awesome.comreload restart and so on :) as always :)postmap -q - pcre:/etc/postfix/header_checks < /etc/postfix/header_checksystemctl reload postfix