My boss wants all email from and all email to a certain email address
to be logged to a file somewhere for archival purposes. Sounds simple
enough, right? I am figuring I could do this with a system filter like so:
# Exim filter
if $message_headers contains "(test|Test)@domain.com" then
logfile /var/log/exim_filterlog
logwrite "$tod_log $message_id message-copy \
$sender_address ($sender_host_name[$sender_host_address]) \
=> $recipients (recipients=$recipients_count) \
subject=$header_subject"
save /mail/spool/domain.com/test.copy 0600
save /mail/archive/domain.com/test 0600
endif
This does not seem to work. No log message gets written to
/var/log/exim_filterlog, no copy of incoming or outgoing messages
gets placed in /mail/spool/domain.com/test.copy or
/mail/archive/domain.com/test, but the message does get delivered
to the correct mail spool (/mail/spool/domain.com/test)
Is there something terribly wrong with my filter? Is there
a better way to accomplish this goal? Basically, I need any
mail sent to (To:, CC:, or BCC:) or sent from (sender claims to
be test@???) written out to a separate file. Note, I am
doing a virtual host setup, separate passwd file per domain,
separate spool directories, no home dirs for .forward files.
-J