Hello,

I am setting up an email server using postfix.

I use an internal domain for internal mails, and address rewriting for
outgoing emails. In main.cf, the parameter

smtp_generic_maps = hash:/etc/postfix/generic

and a file "generic" with lines like this:

[email protected]    [email protected]

As fas as I know, it works, since outgoing emails are sent with the right
sender's external address.

I also use sender_bcc_maps to send a copy of all outgoing emails. In main.cf,
the parameter

sender_bcc_maps = hash:/etc/postfix/sender

and a file "sender" with lines like this:

[email protected]    [email protected]

I am pretty sure that this mechanism worked for a time, but I recently
noticed that it isn't working anymore.

The problem is that the address rewriting sets the sender's external
address AFTER the sender_bcc_maps adds the bcc destinations. So,

it never detects an email from @mycompany.com, because all of them are sent
by @mycompany.local.

I'm looking for a way to have a copy of outgoing emails and sender's
address rewriting at the same time. I have already tried using

regular expressions, but I have failed so far (i am still trying though).

Any ideas will be welcome.

Thank you indeed.

Reply via email to