RE: [Exim] Archiving outgoing e-mail for some user

Top Page
Delete this message
Reply to this message
Author: Bernard Stern
Date:  
To: exim-users
Subject: RE: [Exim] Archiving outgoing e-mail for some user
On Mon, 17 Sep 2001 20:47:00 +0200 (CEST) Leonardo Boselli wrote:

> I have been asked to archive any outgoing message (incoming is
> trivial) for an office.
> I have to explain: this office is manned by 9 different people during the
> week, so a job could be continued by a different person. It is essential
> that ANY message sent from them be archived, to avoid an accidental
> deleting. any of these message arriva with a from: field as
> fl-name@???
> where name is the originator name to ease handling or replies.
> I wish that any outgoing messages whit a from of the type fl-*
> will be forwarded to another (fixed0 address, possibly unless that fixed
> address is the rcpt address ...), beside the original recipient (unseen
> rule?!)
> I could use it either at smtp level or at director level ...
> suggestions ?
> (i have to process according the from part, not the rcpt !)


I have done just this a few weeks ago also for a subset
of users in one of our offices. I had one more problem:
the host hasting the archive is not the localhost.
Eventually I ended up in putting both incoming and outgoing
archiving into a filter (after tweaking with directors and
routers, I came to the conclusion that for what I wanted,
I needed the exim 4 flexibility to obtain a clean solution :-) ):

# (...) the generic anti-spam filter preceding this one

# Outgoing mails
# We need to check the sender host address for outgoing mails;
# potentially, lusers will be sending from the x, y and z subnets.
if ( $sender_host_address is ""
  or $sender_host_address is 127.0.0.1
  or $sender_host_address begins "1.2.x."
  or $sender_host_address begins "1.2.y."
  or $sender_host_address begins "1.2.z.")
and ${domain:$sender_address} matches "some.domain" then
    if ${lookup{${lc:$sender_address_local_part}}lsearch{/path/to/to-archive/users}{yes}{no}} is "yes" then
      unseen deliver archive-address@???
    endif


# Incoming mails
elif foranyaddress $recipients
  (${lookup{${lc:${local_part:$thisaddress}}}lsearch{/path/to/to-archive/users}{yes}{no}} is "yes") then
      unseen deliver archive-address@???
    endif



Naturally, thanks the many expansion variables and operators, you
have almost unlimited possibilities to design conditions
appropriate to your needs.

HTH,

Bernard Stern, SWITCH

____________S_W_I_T_CH___Swiss Academic_______________________________________
        mail: SWITCH Head Office       a          Tel: +41 1 268 1520
              Limmatquai 138           n          Fax: +41 1 268 1568
              CH-8001 Zurich           d     e-mail: stern at switch dot ch
________________________________________Reseach Network_______________________