I need to archive important mail incoming for specific address in case it gets accidentally deleted from email server, etc.
Either saving or using a pipe to archive it on backup machine is fine (I can
rsync the backup automatically later, etc).
However, I have trouble to get
system_filter working. I have configured it this way so far:
system_filter = /etc/exim4/system_filter system_filter_user = Debian-exim system_filter_group = Debian-exim system_filter_directory_transport = local_copy_to_directory # transport section local_copy_to_directory: driver = appendfile delivery_date_add envelope_to_add return_path_add group = Debian-exim user = Debian-exim mode = 0660 maildir_format = true create_directory = true
# Exim filter if $local_part is "example" then unseen save /tmp/example_dir endif
Nothing gets written in logs, nothing gets saved (normal delivery occurs of course).
When I change
$local_part in system filter file to
root and test it like so:
% exim -bF /etc/exim4/system_filter -d-all+filter -f email@example.com <tfpmet Exim version 4.89 uid=0 gid=0 pid=1261 D=200 ... Return-path taken from "Return-path:" header line Return-path = firstname.lastname@example.org Sender = email@example.com Recipient = firstname.lastname@example.org Testing Exim filter file "/etc/exim4/system_filter" Condition is true: $local_part is root Unseen save message to: /tmp/example_dir Filtering did not set up a significant delivery. Normal delivery will occur. >>>>>>>>>>>>>>>> Exim pid=1261 terminating with rc=0 >>>>>>>>>>>>>>>>
It clearly says:
Condition is true: $local_part is root Unseen save message to: /tmp/example_dir
However, nothing gets saved again.
OS: Debian 9.11 amd64.
I'd prefer to achieve this result using system filter, but any good solution would do really.