I have a postfix server that delivers mail and send a copy of the outgoing mail to a second server for content analysis using the following configuration (addresses and IPs have been replaced):
sender_bcc_maps = pcre:/$config_directory/sender_bcc
sender_bcc :
/^(.*)@(.*)$/ ${1}@tst.test.com
trasnport
tst.test.com smtp:[192.168.1.1]
Unfortunately, the configuration above doesn't preserve the envelop so I don't get the original recipient on the second server. The goal in having the original recipient is to catch BCCs...Is there a way to do it just by configuring Postfix? An example of a good result would be to have postfix add something like
x-bcc: test@test.com
or
x-original-recipient: test@test.com
to the email headers sent to the second server (and only them. We don't want to add a bcc header or anything like that to the email that is delivered to the users, obviously).
I've looked everywhere and haven't found anything to add the original recipient. Maybe there's another way? Any suggestion to reach the final goal is welcome!
Thanks!