exim4: how to add an address as BCC to all the outgoing emails?

exim4: how to add an address as BCC to all the outgoing emails?

I'm working on an Ubuntu 20.04 web server where exim4 is used to send emails from the PHP application running on it.

Due to diagnostic and archival needs, I need to configure exim4 to automatically BCC an additional address to ALL the outgoing emails.

TO be cleared: all the original recipients of the outgoing email must remain the same. I just need to add my additional [email protected] address to the list (as BCC).

My exim4 skill are near-zero (I generally use postfix), so please behave ;-).

I tried to follow along this post, but nothing happens. I don't have a /etc/exim/exim.conf (most likely due to the "split configuration" mode of exim4) so I created a new file in /etc/exim4/conf.d/main/nano 95_zane with this:

system_filter = /etc/exim4/exim.filter

Then I created /etc/exim4/exim.filter:

if first_delivery
   and ("$h_to:, $h_cc:, $h_bcc" not contains "example.com")
   and ("$h_from:" not contains "example.com")
then
   unseen deliver "[email protected]"
endif

I restarted exim4 and re-tried, but nothing happens: the intended recipient gets the message, but my additional address is not BBC'ed.

Thanks for your help!

답변1

Got it! I just had to add system_filter = /etc/exim4/exim.filter directly a the top of /etc/exim4/exim4.conf.template and now it works as expected.

관련 정보