Re: [Exim] separate archiving for incoming and outgoing?

Pàgina inicial
Delete this message
Reply to this message
Autor: Mark Edwards
Data:  
A: wash
CC: mark, exim-users
Assumpte: Re: [Exim] separate archiving for incoming and outgoing?
Odhiambo Washington said:
> * Mark Edwards <mark@???> [20020618 16:47]: wrote:
>> I am a relatively new convert to exim from sendmail. I need to
>> maintain a running backup of mail sent and received by the server, and
>> I'm using the system filter suggested in the FAQ. My question -- is
>> there a way to backup mail received for local users separately from
>> mail sent by local users? I would like to have copies of incoming
>> mail sent to a user called "backup" and copies of outgoing mail sent
>> by local users to a user called "sentmail".
>>
>> Can anyone suggest a way of adding this kind of distinguishing
>> capability to my filter?
>>
>> Here's the filter:
>>
>> # Exim filter
>>
>> # Ignore error messages
>> if error_message then finish endif
>>
>>
>> # Copy if this is the first delivery attempt
>> if first_delivery then
>> unseen deliver backup@??? errors_to postmaster@???
>> endif
>>
>
> I think there is a way....but it means you have to define who local
> users are first then act on that....generate a list of local users to a
> file then define the two rules like this:
>
> # Backup outgoing
>
> if ${lookup{$sender_address}lsearch{/path/to/local_users}{yes}{no}} is
> yes then unseen deliver backup-outgoing@domain
> endif
>
>
> # Backup incoming
>
> if ${lookup{$header_to:}lsearch{/path/to/local_users}{yes}{no}} is yes
> then unseen deliver backup-incoming@domain
> endif


I see two potential problems with this. First, what happens if a message
is From a local user To a local user (a situation that occurs frequently
here)? Ideally, I would like a copy of the outgoing message archived to
the backup-outgoing and a copy of the incoming message archived to the
backup-incoming.
Second, I've got several virtual domains setup with exim, and many of the
legal recipient names (aliases) are not local users. Also, I accept mail
on this machine to any recipient. If it isn't in the aliases list, it
goes to a "lost" user. Nothing ever gets bounced because the address
doesn't exist, and I want to back up everything, not just mail for
legitimate users.
Is it possible to distinguish between mail that is generated by a client
connecting via SMTP (outgoing mail) and mail that is generated by another
mail server communicating with exim (incoming mail)? Perhaps what I want
to do isn't even possible.
Thanks for the help.

--
Mark Edwards
San Francisco, CA