Re: [Exim] exim can handle backup of mails?

Página Inicial
Delete this message
Reply to this message
Autor: Odhiambo G. Washington
Data:  
Para: exim-users
Assunto: Re: [Exim] exim can handle backup of mails?
* Luciano Ferrer <luciano@???> [20040331 16:39]: wrote:
>
> Hi!
>
> Anyone know how can be done monthly backups of mails using exim?
>
> Or something similar...
>
> TIA, and sorry for the bad english...


WARNING: Such an action violates the privacy of your users.
WARNING: Please ensure that Company policy allows it.
WARNING: Ensure that the laws regulation e-communication in your
         country _does_ _not_ prohibit this.


I WARNED YOU!!


If you have just one domain to handle, this is trivial using
shadow_transport. But in this case, I will demonstrate "backup" of
incoming mail only.

On your local_delivery transport, add the following two lines:

 shadow_transport     = backup_delivery
 shadow_condition     = ${lookup{$local_part}lsearch{/usr/local/etc/exim/mail_backup_users}{1}{0}}


Now create the backup_delivery transport, and it should be something
like below:


backup_delivery:
 driver               = appendfile
 delivery_date_add
 envelope_to_add
 file                 = /Mail-backup/${substr_0_7:$tod_log}/${local_part}
 mode                 = 0600
 user                 = exim
 group                = mail
 return_path_add


As root,

mkdir /Mail-backup
chown -R exim_user /Mail-backup    # exim_user is obtained by exim -bP exim_user


The file /usr/local/etc/exim/mail_backup_users contains a list of
local_parts for which you want to make backup copies. If you want to do
for everyone, then comment out the condition above.

Now what happens is that every month, you will get a file like
/Mail-backup/2004-02/luciano - this file is in mbox format. You can
stash that away to some device at the end of every month, then blow away
/Mail-backup/2004-02/. If for some reason luciano wants his mails for
the month of February 2004, and you have procmail installed, you can
do something like

formail -s sendmail lucian@??? < /path/to/where/you-kept/2004-02/luciano


Hope that helps.




        cheers
       - wash
+----------------------------------+-----------------------------------------+
Odhiambo Washington                     . WANANCHI ONLINE LTD (Nairobi, KE)  |
<wash at wananchi dot com>              . 1ere Etage, Loita Hse, Loita St.,  |
GSM: (+254) 722 743 223                 . # 10286, 00100 NAIROBI             |
GSM: (+254) 733 744 121                 . (+254) 020 313 985 - 9             |
+---------------------------------+------------------------------------------+
"Oh My God! They killed init! You Bastards!"
                         --from a /. post