Exim | Send a copy of all outgoing messages to another mailbox

Steps:

1.

1
2
[server1.domain.com:/root]# cat /etc/exim.conf | grep ^system_filter
system_filter = /etc/system_filter.exim

then

2.

1
[server1.domain.com:/root]# nano system_filter = /etc/system_filter.exim

and find the line with following content

1
2
3
if not first_delivery
then finish
endif

3. After the above line add following

1
2
3
4
if $header_from: contains "@domain.com"
then
unseen deliver "monitor@domain.com"
endif

4. Restart exim service

1
[server1.domain.com:/root]# service exim restart

The above filter rule sends a copy of every message from domain.com to monitor@domain.com [unless the message already has that recipient – Exim never does duplicate deliveries].

 

———————————————————

USTTEKI CALISIYORDU ANCAK GELEN TUM MAILLERINDE HARICI BIR MAILE GITMESI GEREKIYORDU

BU DURUMDA USTTEKINI SALLADIK YERINE BUNU KOYDUK

GAYET ACIK KONU

 


nano /etc/system_filter.exim

#Incoming/Outgoing Email Archiving
if ("$h_to:, $h_cc:, $h_bcc" contains "YOURDOMAIN.com")
then
unseen deliver "incoming@YOURDOMAIN.com"
endif

if $sender_address_domain is YOURDOMAIN.com
then
unseen deliver "outgoing@YOURDOMAIN.com"
endif